Enable preservation for SIIT-DC

This commit is contained in:
Vili Sinervä 2025-06-29 15:12:28 +03:00
parent 1e91ba677d
commit 44af0493db
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
3 changed files with 33 additions and 2 deletions

View file

@ -1,6 +1,7 @@
{ ... }: { lib, ... }:
{ {
networking.hostId = "f1636fe0"; preservation.enable = true;
swapDevices = lib.mkForce [ ];
imports = [ imports = [
../../shared/base.nix ../../shared/base.nix

View file

@ -1,5 +1,6 @@
{ lib, modulesPath, ... }: { lib, modulesPath, ... }:
{ {
networking.hostId = "f1636fe0";
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = lib.mkForce false;
networking.useDHCP = false; networking.useDHCP = false;
systemd.network.enable = true; systemd.network.enable = true;

View file

@ -34,6 +34,35 @@
ssss ssss
]; ];
######################################## Preservation ###########################################
preservation = {
enable = lib.mkDefault false;
preserveAt."/persist" = {
files = [
{
file = "/etc/machine-id";
inInitrd = true;
}
{
file = "/etc/ssh/ssh_host_rsa_key";
how = "symlink";
inInitrd = true; # sops-nix
}
{
file = "/etc/ssh/ssh_host_ed25519_key";
how = "symlink";
inInitrd = true; # sops-nix
}
];
directories = [
"/var/lib/systemd/timers"
"/var/lib/nixos"
"/var/log"
];
};
};
systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ];
######################################## ZSH configuration ###################################### ######################################## ZSH configuration ######################################
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
environment.shells = with pkgs; [ zsh ]; environment.shells = with pkgs; [ zsh ];