added persistence.nix

This commit is contained in:
Sam 2024-05-25 20:48:50 +01:00
parent 5b942d4708
commit fb42ab7421
2 changed files with 25 additions and 17 deletions

View File

@ -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"
];
};
}

View File

@ -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;