Update configuration.nix
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
# NixOS USB system with auto-update from public Git repo
|
||||
# Repo: https://git.skarockoi.de/ska/nixos-production.git
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
@@ -9,8 +6,7 @@ let
|
||||
in
|
||||
|
||||
{
|
||||
imports =
|
||||
[ ./hardware-configuration.nix ];
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
@@ -61,38 +57,23 @@ in
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
curl
|
||||
wget
|
||||
vim
|
||||
openssh
|
||||
obsidian
|
||||
libreoffice
|
||||
keepassxc
|
||||
thunderbird
|
||||
tor-browser
|
||||
inkscape
|
||||
gimp
|
||||
pdfarranger
|
||||
epiphany
|
||||
shortwave
|
||||
gnomeExtensions.gsconnect
|
||||
gnomeExtensions.dash-to-dock
|
||||
git vim curl wget openssh
|
||||
obsidian libreoffice keepassxc thunderbird tor-browser inkscape gimp pdfarranger
|
||||
epiphany gnomeExtensions.gsconnect gnomeExtensions.dash-to-dock
|
||||
];
|
||||
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# === Auto-update script with proper NIX_PATH for systemd ===
|
||||
# Auto-update script with correct NIX_PATH
|
||||
environment.etc."update-nixos-config.sh".text = ''
|
||||
#!/run/current-system/sw/bin/bash
|
||||
set -e
|
||||
|
||||
# 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"
|
||||
# Use the standard NixOS channel path for nixpkgs
|
||||
export NIX_PATH="nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos"
|
||||
|
||||
LOCAL_PATH="${gitLocalPath}"
|
||||
REPO_URL="${gitRepoUrl}"
|
||||
LOCAL_PATH="/var/lib/nixos-config"
|
||||
REPO_URL="https://git.skarockoi.de/ska/nixos-production.git"
|
||||
|
||||
if [ ! -d "$LOCAL_PATH/.git" ]; then
|
||||
mkdir -p "$LOCAL_PATH"
|
||||
@@ -117,7 +98,7 @@ in
|
||||
'';
|
||||
environment.etc."update-nixos-config.sh".mode = "0700";
|
||||
|
||||
# === Systemd timer: boot + hourly ===
|
||||
# Simple systemd service — no 'path', no 'environment'
|
||||
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