fix: package theme engine and system scripts and fix env-update scriptability
This commit is contained in:
@@ -32,8 +32,8 @@
|
|||||||
gcad = "git commit -a --amend";
|
gcad = "git commit -a --amend";
|
||||||
|
|
||||||
# NixOS commands
|
# NixOS commands
|
||||||
sys-update = "sudo nixos-rebuild switch --flake /etc/nixos#default --impure";
|
sys-update = "nomarchy-sys-update";
|
||||||
env-update = "nomarchy-preflight-migration && home-manager switch --flake /etc/nixos#default --impure";
|
env-update = "nomarchy-env-update";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
./options.nix
|
./options.nix
|
||||||
./state.nix
|
./state.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
|
./scripts.nix
|
||||||
./systemd.nix
|
./systemd.nix
|
||||||
./virtualization.nix
|
./virtualization.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
|
|||||||
64
core/system/scripts.nix
Normal file
64
core/system/scripts.nix
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
# System script dependencies
|
||||||
|
systemScriptDeps = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
gnused
|
||||||
|
gnugrep
|
||||||
|
findutils
|
||||||
|
gawk
|
||||||
|
jq
|
||||||
|
nixos-rebuild
|
||||||
|
home-manager
|
||||||
|
git
|
||||||
|
sudo
|
||||||
|
brightnessctl
|
||||||
|
playerctl
|
||||||
|
pamixer
|
||||||
|
pciutils
|
||||||
|
usbutils
|
||||||
|
networkmanager
|
||||||
|
lshw
|
||||||
|
parted
|
||||||
|
btrfs-progs
|
||||||
|
cryptsetup
|
||||||
|
gum
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
libnotify
|
||||||
|
bc
|
||||||
|
supergfxctl
|
||||||
|
systemd
|
||||||
|
];
|
||||||
|
|
||||||
|
nomarchy-system-scripts = pkgs.stdenv.mkDerivation {
|
||||||
|
pname = "nomarchy-system-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 systemScriptDeps}"
|
||||||
|
for file in $out/bin/*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
wrapProgram "$file" \
|
||||||
|
--prefix PATH : "$deps" \
|
||||||
|
--set NOMARCHY_PATH "/etc/nixos/nomarchy"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = [ nomarchy-system-scripts ];
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ in
|
|||||||
../themes/engine/stylix-compat.nix
|
../themes/engine/stylix-compat.nix
|
||||||
../themes/engine/loader.nix
|
../themes/engine/loader.nix
|
||||||
../themes/engine/files.nix
|
../themes/engine/files.nix
|
||||||
|
../themes/engine/scripts.nix
|
||||||
../themes/engine/stylix.nix
|
../themes/engine/stylix.nix
|
||||||
../themes/engine/switcher.nix
|
../themes/engine/switcher.nix
|
||||||
./apps/alacritty/default.nix
|
./apps/alacritty/default.nix
|
||||||
|
|||||||
18
features/scripts/utils/nomarchy-env-update
Normal file
18
features/scripts/utils/nomarchy-env-update
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Nomarchy Environment Update Script
|
||||||
|
# 1. Runs the pre-flight state migration
|
||||||
|
# 2. Applies user-level Home Manager changes
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Use the pre-flight migration script to ensure the state is synced before evaluation
|
||||||
|
if command -v nomarchy-preflight-migration >/dev/null 2>&1; then
|
||||||
|
nomarchy-preflight-migration
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Apply Home Manager changes from the local flake
|
||||||
|
echo "Applying user-level changes..."
|
||||||
|
home-manager switch --flake /etc/nixos#default --impure
|
||||||
|
|
||||||
|
echo "Environment update complete."
|
||||||
12
features/scripts/utils/nomarchy-sys-update
Normal file
12
features/scripts/utils/nomarchy-sys-update
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Nomarchy System Update Script
|
||||||
|
# 1. Applies system-wide NixOS changes
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Apply NixOS changes from the local flake
|
||||||
|
echo "Applying system-level changes..."
|
||||||
|
sudo nixos-rebuild switch --flake /etc/nixos#default --impure
|
||||||
|
|
||||||
|
echo "System update complete."
|
||||||
52
themes/engine/scripts.nix
Normal file
52
themes/engine/scripts.nix
Normal 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 ];
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
TEMPLATES_DIR="$NOMARCHY_PATH/assets/themed"
|
TEMPLATES_DIR="$NOMARCHY_PATH/themes/templates"
|
||||||
USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themed"
|
USER_TEMPLATES_DIR="$HOME/.config/nomarchy/themes/templates"
|
||||||
NEXT_THEME_DIR="$HOME/.config/nomarchy/current/theme"
|
NEXT_THEME_DIR="$HOME/.config/nomarchy/current/theme"
|
||||||
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"
|
COLORS_FILE="$NEXT_THEME_DIR/colors.toml"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user