Update configuration.nix
This commit is contained in:
@@ -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 <nixpkgs/nixos>
|
||||
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";
|
||||
|
||||
Reference in New Issue
Block a user