diff --git a/hosts/common/optional/persistence.nix b/hosts/common/optional/persistence.nix new file mode 100644 index 0000000..1f2f8c4 --- /dev/null +++ b/hosts/common/optional/persistence.nix @@ -0,0 +1,17 @@ +{ + fileSystems."/persist".neededForBoot = true; + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/etc/nixos" + "/var/log" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + "/etc/NetworkManager/system-connections" + ]; + files = [ + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + ]; + }; +} diff --git a/hosts/sparky/default.nix b/hosts/sparky/default.nix index f27eb2c..9781027 100644 --- a/hosts/sparky/default.nix +++ b/hosts/sparky/default.nix @@ -19,26 +19,10 @@ in # Import optional options ../common/optional/openssh.nix + ../common/optional/persistence.nix ]; - fileSystems."/persist".neededForBoot = true; - environment.persistence."/persist" = { - hideMounts = true; - directories = [ - "/etc/nixos" - "/var/log" - "/var/lib/nixos" - "/var/lib/flatpak" - "/var/lib/systemd/coredump" - "/etc/NetworkManager/system-connections" - ]; - files = [ - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - ]; - }; - boot = { loader = { systemd-boot.enable = true; @@ -47,6 +31,13 @@ in }; }; + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/var/lib/flatpak" + ]; + }; + networking = { hostName = "sparky"; networkmanager.enable = true;