refactor: major architectural restructure for theme-centric organization
Theme System: - Move all theme app configs to apps/ subdirectory (20 themes) - Add theme-loader.nix for dynamic theme config deployment - Simplify stylix.nix to focus on base theming only Override System: - Add overrides.nix for file-based config overrides - Add behavior-configs.nix for non-visual configuration - Split hypr/nomarchy.conf into behavior vs visual sections Module Improvements: - Add lib.mkDefault to all customizable settings - Add modules/lib/ with shared utilities and state schema - Update all home and system modules for downstream overridability Installer: - New minimal TTY installer (installer/install.sh) - Golden path: BTRFS + LUKS2 (disko-golden.nix) - New installer-iso.nix for TTY-only installation - Keep graphical installer as installerIsoGraphical option Cleanup: - Remove obsolete install.sh, disko-ext4.nix, install-nomarchy.sh - Update live-iso.nix references - Add .claude/ to .gitignore for local IDE settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,62 +1,151 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
# Core dependencies needed by most Nomarchy scripts
|
||||
nomarchy-deps = with pkgs; [
|
||||
gum
|
||||
hyprland
|
||||
procps
|
||||
libnotify
|
||||
# Core dependencies needed by most scripts (minimal set)
|
||||
coreDeps = with pkgs; [
|
||||
coreutils
|
||||
gnused
|
||||
gnugrep
|
||||
pciutils
|
||||
findutils
|
||||
jq
|
||||
swww
|
||||
xmlstarlet
|
||||
wl-clipboard
|
||||
grim
|
||||
slurp
|
||||
brightnessctl
|
||||
playerctl
|
||||
pamixer
|
||||
pulseaudio
|
||||
wireplumber
|
||||
swayosd
|
||||
gawk
|
||||
curl
|
||||
wget
|
||||
# Add any others commonly used in bin/
|
||||
jq
|
||||
];
|
||||
|
||||
# Category-specific dependencies
|
||||
categoryDeps = with pkgs; {
|
||||
appearance = [
|
||||
swww
|
||||
libnotify
|
||||
];
|
||||
|
||||
apps = [
|
||||
hyprland
|
||||
libnotify
|
||||
];
|
||||
|
||||
hardware = [
|
||||
brightnessctl
|
||||
playerctl
|
||||
pamixer
|
||||
pciutils
|
||||
libnotify
|
||||
];
|
||||
|
||||
system = [
|
||||
gum
|
||||
libnotify
|
||||
curl
|
||||
wget
|
||||
];
|
||||
|
||||
utils = [
|
||||
gum
|
||||
hyprland
|
||||
libnotify
|
||||
wl-clipboard
|
||||
grim
|
||||
slurp
|
||||
xmlstarlet
|
||||
curl
|
||||
wget
|
||||
];
|
||||
|
||||
wm = [
|
||||
hyprland
|
||||
swayosd
|
||||
libnotify
|
||||
procps
|
||||
];
|
||||
};
|
||||
|
||||
# All dependencies combined (for scripts that might call others)
|
||||
allDeps = coreDeps ++ (lib.unique (lib.flatten (builtins.attrValues categoryDeps)));
|
||||
|
||||
# Environment variables to inject
|
||||
envVars = {
|
||||
NOMARCHY_TOGGLE_SUSPEND = if config.nomarchy.toggles.suspend then "true" else "false";
|
||||
NOMARCHY_TOGGLE_SCREENSAVER = if config.nomarchy.toggles.screensaver then "true" else "false";
|
||||
NOMARCHY_TOGGLE_IDLE = if config.nomarchy.toggles.idle then "true" else "false";
|
||||
NOMARCHY_TOGGLE_NIGHTLIGHT = if config.nomarchy.toggles.nightlight then "true" else "false";
|
||||
NOMARCHY_TOGGLE_WAYBAR = if config.nomarchy.toggles.waybar then "true" else "false";
|
||||
NOMARCHY_TOGGLE_SKIP_VSCODE_THEME = if config.nomarchy.toggles.skipVsCodeTheme then "true" else "false";
|
||||
NOMARCHY_MONOSPACE_FONT = config.nomarchy.fonts.monospace;
|
||||
};
|
||||
|
||||
# Build wrapper arguments for environment variables
|
||||
envWrapperArgs = lib.concatStringsSep " " (
|
||||
lib.mapAttrsToList (name: value: "--set ${name} \"${value}\"") envVars
|
||||
);
|
||||
|
||||
nomarchy-scripts = pkgs.stdenv.mkDerivation {
|
||||
pname = "nomarchy-scripts";
|
||||
version = "1.0.0";
|
||||
src = ../../bin;
|
||||
|
||||
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
find . -type f -exec cp {} $out/bin/ \;
|
||||
|
||||
# Copy scripts preserving directory structure for category detection
|
||||
for category in appearance apps hardware system utils wm; do
|
||||
if [ -d "$category" ]; then
|
||||
for script in "$category"/*; do
|
||||
if [ -f "$script" ]; then
|
||||
cp "$script" "$out/bin/"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
chmod +x $out/bin/*
|
||||
patchShebangs $out/bin
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
# Wrap every script to ensure dependencies are in PATH and inject configuration
|
||||
# Wrap scripts with category-specific dependencies
|
||||
for file in $out/bin/*; do
|
||||
if [ -f "$file" ]; then
|
||||
scriptName=$(basename "$file")
|
||||
|
||||
# Determine category from original source location
|
||||
category=""
|
||||
for cat in appearance apps hardware system utils wm; do
|
||||
if [ -f "$src/$cat/$scriptName" ]; then
|
||||
category="$cat"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Select dependencies based on category
|
||||
case "$category" in
|
||||
appearance)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.appearance)}"
|
||||
;;
|
||||
apps)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.apps)}"
|
||||
;;
|
||||
hardware)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.hardware)}"
|
||||
;;
|
||||
system)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.system)}"
|
||||
;;
|
||||
utils)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.utils)}"
|
||||
;;
|
||||
wm)
|
||||
deps="${lib.makeBinPath (coreDeps ++ categoryDeps.wm)}"
|
||||
;;
|
||||
*)
|
||||
# Fallback to all deps for unknown categories
|
||||
deps="${lib.makeBinPath allDeps}"
|
||||
;;
|
||||
esac
|
||||
|
||||
wrapProgram "$file" \
|
||||
--prefix PATH : ${lib.makeBinPath nomarchy-deps} \
|
||||
--set NOMARCHY_TOGGLE_SUSPEND "${if config.nomarchy.toggles.suspend then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_SCREENSAVER "${if config.nomarchy.toggles.screensaver then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_IDLE "${if config.nomarchy.toggles.idle then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_NIGHTLIGHT "${if config.nomarchy.toggles.nightlight then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_WAYBAR "${if config.nomarchy.toggles.waybar then "true" else "false"}" \
|
||||
--set NOMARCHY_TOGGLE_SKIP_VSCODE_THEME "${if config.nomarchy.toggles.skipVsCodeTheme then "true" else "false"}" \
|
||||
--set NOMARCHY_MONOSPACE_FONT "${config.nomarchy.fonts.monospace}"
|
||||
--prefix PATH : "$deps" \
|
||||
${envWrapperArgs}
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user