diff --git a/common/auto-update.nix b/common/auto-update.nix new file mode 100644 index 0000000..bd84a44 --- /dev/null +++ b/common/auto-update.nix @@ -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 + }; + }; +} \ No newline at end of file diff --git a/common/common.nix b/common/common.nix index f9dae4f..2ee406b 100644 --- a/common/common.nix +++ b/common/common.nix @@ -5,6 +5,7 @@ ./flakes.nix ./pia.nix ./zerotier.nix + ./auto-update.nix ./boot/firmware.nix ./boot/efi.nix ./boot/bios.nix diff --git a/lockfile-update.sh b/lockfile-update.sh new file mode 100755 index 0000000..068805e --- /dev/null +++ b/lockfile-update.sh @@ -0,0 +1 @@ +nix flake update --recreate-lock-file --commit-lock-file \ No newline at end of file diff --git a/machines/liza/configuration.nix b/machines/liza/configuration.nix index 382f776..c2e1903 100644 --- a/machines/liza/configuration.nix +++ b/machines/liza/configuration.nix @@ -19,6 +19,8 @@ device.path = "/dev/disk/by-uuid/2f736fba-8a0c-4fb5-8041-c849fb5e1297"; }; + system.autoUpgrade.enable = true; + networking.hostName = "liza"; networking.interfaces.enp1s0.useDHCP = true; diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..c49880c --- /dev/null +++ b/update.sh @@ -0,0 +1,3 @@ +git pull +nix flake update --recreate-lock-file # intentionally ignore the lockfile +sudo nixos-rebuild switch --flake . \ No newline at end of file