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
|
# Repo: https://git.skarockoi.de/ska/nixos-production.git
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
@@ -64,13 +64,12 @@ in
|
|||||||
git
|
git
|
||||||
curl
|
curl
|
||||||
wget
|
wget
|
||||||
sl
|
vim
|
||||||
nano
|
openssh
|
||||||
openssh # optional, for scp etc.
|
|
||||||
thunderbird
|
|
||||||
obsidian
|
obsidian
|
||||||
libreoffice
|
libreoffice
|
||||||
keepassxc
|
keepassxc
|
||||||
|
thunderbird
|
||||||
tor-browser
|
tor-browser
|
||||||
inkscape
|
inkscape
|
||||||
gimp
|
gimp
|
||||||
@@ -83,12 +82,14 @@ in
|
|||||||
|
|
||||||
programs.firefox.enable = true;
|
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 = ''
|
environment.etc."update-nixos-config.sh".text = ''
|
||||||
#!/run/current-system/sw/bin/bash
|
#!/run/current-system/sw/bin/bash
|
||||||
set -e
|
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}"
|
LOCAL_PATH="${gitLocalPath}"
|
||||||
REPO_URL="${gitRepoUrl}"
|
REPO_URL="${gitRepoUrl}"
|
||||||
@@ -116,7 +117,7 @@ in
|
|||||||
'';
|
'';
|
||||||
environment.etc."update-nixos-config.sh".mode = "0700";
|
environment.etc."update-nixos-config.sh".mode = "0700";
|
||||||
|
|
||||||
# === Systemd timer for automatic updates ===
|
# === Systemd timer: boot + hourly ===
|
||||||
systemd.services.nixos-git-update = {
|
systemd.services.nixos-git-update = {
|
||||||
description = "Update NixOS from public Git config";
|
description = "Update NixOS from public Git config";
|
||||||
script = "/etc/update-nixos-config.sh";
|
script = "/etc/update-nixos-config.sh";
|
||||||
|
|||||||
Reference in New Issue
Block a user