fix(distro): fix /etc/nixos ownership, theme discovery, and CLI wrappers

- installer: set recursive ownership of /etc/nixos to main user post-install
- themes: fix NOMARCHY_PATH and discovery logic for Lua theme menu
- scripts: update CLI wrappers (font, theme, wallpaper) to use Walker menus
- core: remove obsolete NOMARCHY_PATH and cleanup dead code
- features: add pkgs.lua for Walker and remove obsolete switcher.nix
- docs: update ROADMAP.md, SCRIPTS.md and STRUCTURE.md
This commit is contained in:
Bernardo Magri
2026-05-03 08:59:13 +01:00
parent bef7be01b8
commit 7064108ce7
17 changed files with 30 additions and 94 deletions

View File

@@ -41,7 +41,7 @@ let
if [ -f "$file" ]; then
wrapProgram "$file" \
--prefix PATH : "$deps" \
--set NOMARCHY_PATH "/etc/nixos/nomarchy"
--set NOMARCHY_PATH "/etc/nixos"
fi
done
'';

View File

@@ -3,7 +3,7 @@ set -e
{
find ~/.config/nomarchy/themes/ -mindepth 1 -maxdepth 1 \( -type d -o -type l \) -printf '%f\n'
find "$NOMARCHY_PATH/assets/themes/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
find "$NOMARCHY_PATH/themes/palettes/" -mindepth 1 -maxdepth 1 -type d -printf '%f\n'
} | sort -u | while read -r name; do
echo "$name" | sed -E 's/(^|-)([a-z])/\1\u\2/g; s/-/ /g'
done

View File

@@ -1,64 +0,0 @@
{ config, pkgs, lib, ... }:
let
nomarchyLib = import ../../lib { inherit lib; };
themeList = builtins.concatStringsSep "\\n" nomarchyLib.themeNames;
nomarchy-theme-selector = pkgs.writeShellScriptBin "nomarchy-theme-selector" ''
SELECTED_THEME=$(echo -e "${themeList}" | walker --dmenu)
if [ -n "$SELECTED_THEME" ]; then
nomarchy-theme-set "$SELECTED_THEME"
fi
'';
nomarchy-font-selector = pkgs.writeShellScriptBin "nomarchy-font-selector" ''
STATE_DIR="${config.home.homeDirectory}/.config/nomarchy"
STATE_FILE="$STATE_DIR/state.json"
mkdir -p "$STATE_DIR"
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
# Simple list of common nerd fonts, could be expanded
FONTS="JetBrainsMono Nerd Font\nRobotoMono Nerd Font\nFiraCode Nerd Font\nUbuntuMono Nerd Font"
SELECTED_FONT=$(echo -e "$FONTS" | walker --dmenu)
if [ -n "$SELECTED_FONT" ]; then
TMP_JSON=$(mktemp)
jq --arg font "$SELECTED_FONT" '.font = $font' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
nomarchy-env-update
fi
'';
nomarchy-wallpaper-selector = pkgs.writeShellScriptBin "nomarchy-wallpaper-selector" ''
STATE_DIR="${config.home.homeDirectory}/.config/nomarchy"
STATE_FILE="$STATE_DIR/state.json"
THEMES_DIR="${config.xdg.dataHome}/nomarchy/themes"
mkdir -p "$STATE_DIR"
[[ ! -f $STATE_FILE ]] && echo "{}" > "$STATE_FILE"
# List all images in all themes backgrounds
# We search in the system-wide flake source for distro wallpapers to avoid Nix Store bloat
WALLPAPERS=$(find "${config.xdg.dataHome}/nomarchy/themes" -type f \( -name "*.jpg" -o -name "*.png" \) 2>/dev/null)
DISTRO_THEMES="/etc/nixos/nomarchy/assets/themes"
if [ -d "$DISTRO_THEMES" ]; then
WALLPAPERS="$WALLPAPERS\n$(find "$DISTRO_THEMES" -type f \( -name "*.jpg" -o -name "*.png" \))"
fi
# Include user themes if they exist
if [ -d "${config.home.homeDirectory}/.config/nomarchy/themes" ]; then
WALLPAPERS="$WALLPAPERS\n$(find "${config.home.homeDirectory}/.config/nomarchy/themes" -type f \( -name "*.jpg" -o -name "*.png" \))"
fi
SELECTED_WP=$(echo -e "$WALLPAPERS" | walker --dmenu)
if [ -n "$SELECTED_WP" ]; then
TMP_JSON=$(mktemp)
jq --arg wp "$SELECTED_WP" '.wallpaper = $wp' "$STATE_FILE" > "$TMP_JSON" && mv "$TMP_JSON" "$STATE_FILE"
swww img "$SELECTED_WP" --transition-type outer --transition-pos 0.85,0.97 --transition-step 90 &
nomarchy-env-update
fi
'';
in
{
home.packages = [ nomarchy-theme-selector nomarchy-font-selector nomarchy-wallpaper-selector ];
}