From 4ac8f3fade1e15882132fcd28ee8f60b77681687 Mon Sep 17 00:00:00 2001 From: ska Date: Fri, 19 Dec 2025 15:32:45 +0000 Subject: [PATCH] Update configuration.nix --- configuration.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/configuration.nix b/configuration.nix index 902e58b..89ccc62 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -# NixOS USB configuration with auto-update from public Git repo +# NixOS USB system with auto-update from public Git repo # Repo: https://git.skarockoi.de/ska/nixos-production.git { config, pkgs, ... }: @@ -64,13 +64,12 @@ in git curl wget - sl - nano - openssh # optional, for scp etc. - thunderbird + vim + openssh obsidian libreoffice keepassxc + thunderbird tor-browser inkscape gimp @@ -83,12 +82,14 @@ in programs.firefox.enable = true; - # === Auto-update script: fetch config from public Git repo === + # === Auto-update script with proper NIX_PATH for systemd === environment.etc."update-nixos-config.sh".text = '' #!/run/current-system/sw/bin/bash set -e - export PATH="${pkgs.git}/bin:${pkgs.nix}/bin:/run/current-system/sw/bin" + # Critical: set NIX_PATH so nixos-rebuild can find + export NIX_PATH="nixpkgs=/run/current-system/nixos" + export PATH="/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin" LOCAL_PATH="${gitLocalPath}" REPO_URL="${gitRepoUrl}" @@ -116,7 +117,7 @@ in ''; environment.etc."update-nixos-config.sh".mode = "0700"; - # === Systemd timer for automatic updates === + # === Systemd timer: boot + hourly === systemd.services.nixos-git-update = { description = "Update NixOS from public Git config"; script = "/etc/update-nixos-config.sh";