update management

This commit is contained in:
zuckerberg 2021-08-26 20:36:16 -04:00
parent 152ca7a607
commit 68254e15d1
5 changed files with 21 additions and 0 deletions

14
common/auto-update.nix Normal file
View File

@ -0,0 +1,14 @@
{ config, lib, ... }:
# Modify auto-update so that it pulls a flake and much
let
cfg = config.system.autoUpgrade;
in {
config = lib.mkIf cfg.enable {
system.autoUpgrade = {
flake = "git+https://git.neet.dev/zuckerberg/nix-config.git";
flags = [ "--recreate-lock-file" ]; # ignore lock file, just pull the latest
};
};
}

View File

@ -5,6 +5,7 @@
./flakes.nix ./flakes.nix
./pia.nix ./pia.nix
./zerotier.nix ./zerotier.nix
./auto-update.nix
./boot/firmware.nix ./boot/firmware.nix
./boot/efi.nix ./boot/efi.nix
./boot/bios.nix ./boot/bios.nix

1
lockfile-update.sh Executable file
View File

@ -0,0 +1 @@
nix flake update --recreate-lock-file --commit-lock-file

View File

@ -19,6 +19,8 @@
device.path = "/dev/disk/by-uuid/2f736fba-8a0c-4fb5-8041-c849fb5e1297"; device.path = "/dev/disk/by-uuid/2f736fba-8a0c-4fb5-8041-c849fb5e1297";
}; };
system.autoUpgrade.enable = true;
networking.hostName = "liza"; networking.hostName = "liza";
networking.interfaces.enp1s0.useDHCP = true; networking.interfaces.enp1s0.useDHCP = true;

3
update.sh Executable file
View File

@ -0,0 +1,3 @@
git pull
nix flake update --recreate-lock-file # intentionally ignore the lockfile
sudo nixos-rebuild switch --flake .