fix: package theme engine and system scripts and fix env-update scriptability

This commit is contained in:
Bernardo Magri
2026-04-13 11:37:03 +01:00
parent f0800e60ca
commit 6f4741c060
8 changed files with 152 additions and 4 deletions

52
themes/engine/scripts.nix Normal file
View File

@@ -0,0 +1,52 @@
{ config, pkgs, lib, ... }:
let
nomarchyLib = import ../../lib { inherit lib; };
# Dependencies for theme engine scripts
themeDeps = with pkgs; [
coreutils
gnused
gnugrep
findutils
gawk
jq
swww
libnotify
gum
brightnessctl
playerctl
pamixer
bc
];
nomarchy-theme-engine-scripts = pkgs.stdenv.mkDerivation {
pname = "nomarchy-theme-engine-scripts";
version = "1.0.0";
src = ./scripts;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
mkdir -p $out/bin
cp * $out/bin/
chmod +x $out/bin/*
patchShebangs $out/bin
'';
postFixup = ''
deps="${lib.makeBinPath themeDeps}"
for file in $out/bin/*; do
if [ -f "$file" ]; then
wrapProgram "$file" \
--prefix PATH : "$deps" \
--set NOMARCHY_PATH "/etc/nixos/nomarchy"
fi
done
'';
};
in
{
home.packages = [ nomarchy-theme-engine-scripts ];
}

View File

@@ -1,7 +1,7 @@
#!/bin/bash
TEMPLATES_DIR="$NOMARCHY_PATH/assets/themed"
USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themed"
TEMPLATES_DIR="$NOMARCHY_PATH/themes/templates"
USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themes/templates"
NEXT_THEME_DIR="$HOME/.config/nomarchy/current/theme"
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"