Files
Nomarchy/features/scripts/default.nix
Bernardo Magri b82954a7b5 fix(options): drop dead skipVsCodeTheme + 4 themeLoader.apps toggles
Two clusters of documented-but-non-functional options surfaced during
the Pillar 8 audit, both setting toggles that have zero runtime effect.

1. `nomarchy.toggles.skipVsCodeTheme` was declared in
   core/home/options.nix, defaulted from lib/state-schema.nix, and
   surfaced as `NOMARCHY_TOGGLE_SKIP_VSCODE_THEME` env var in
   features/scripts/default.nix — but `features/apps/vscode.nix` always
   sets `workbench.colorTheme` unconditionally, and no script reads the
   env var. Setting the toggle to true did nothing. Removed from
   options, schema, state, env-var export, and OPTIONS.md.

2. `nomarchy.themeLoader.apps.{waybar,mako,kitty,alacritty}` were
   declared in themes/engine/loader.nix but only `btop` is actually
   wired (line 87 gates the per-theme btop.theme deploy). The other
   four had no consumer. The actual theming pipeline for those apps is
   elsewhere: waybar themes inline from `colorScheme` in waybar.nix;
   kitty and alacritty are themed by stylix targets in
   themes/engine/stylix.nix; mako has no theme integration at all.
   Removed the four dead options + updated OPTIONS.md to list only
   btop with a note about where the other apps' theming lives.
2026-05-19 19:04:25 +01:00

113 lines
2.3 KiB
Nix

{ config, pkgs, lib, ... }:
let
# Core dependencies needed by most scripts (minimal set)
coreDeps = with pkgs; [
coreutils
gnused
gnugrep
findutils
gawk
jq
];
# Category-specific dependencies
categoryDeps = with pkgs; {
appearance = [
swww
libnotify
];
apps = [
hyprland
libnotify
];
hardware = [
brightnessctl
playerctl
pamixer
pciutils
libnotify
];
system = [
gum
libnotify
curl
wget
pkgs.home-manager
nixos-rebuild
];
utils = [
gum
glow
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_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 = ./utils;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp * $out/bin/
chmod +x $out/bin/*
patchShebangs $out/bin
'';
postFixup = ''
# Wrap all scripts with all dependencies for robustness
deps="${lib.makeBinPath allDeps}"
for file in $out/bin/*; do
if [ -f "$file" ]; then
wrapProgram "$file" \
--prefix PATH : "$deps" \
${envWrapperArgs}
fi
done
'';
};
in
{
home.packages = [ nomarchy-scripts ];
}