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