base/snapshot: move sanoid there

This commit is contained in:
2023-07-18 16:32:45 +03:00
parent 46e2d86918
commit 97f720558d
3 changed files with 40 additions and 62 deletions

View File

@@ -67,10 +67,16 @@ in {
stateVersion = "22.11";
timeZone = "UTC";
base.initrd = {
enable = true;
authorizedKeys = builtins.attrValues myData.ssh_pubkeys;
hostKeys = ["/etc/secrets/initrd/ssh_host_ed25519_key"];
base = {
initrd = {
enable = true;
authorizedKeys = builtins.attrValues myData.ssh_pubkeys;
hostKeys = ["/etc/secrets/initrd/ssh_host_ed25519_key"];
};
snapshot = {
enable = true;
mountpoints = ["/var/lib" "/var/log"];
};
};
};
@@ -141,23 +147,6 @@ in {
localuser = null;
};
sanoid = {
enable = true;
templates.prod = {
hourly = 24;
daily = 7;
autosnap = true;
autoprune = true;
};
datasets =
lib.mapAttrs' (name: value: {
name = value.zfs_name;
value = {use_template = ["prod"];};
})
backup_paths;
extraArgs = ["--verbose"];
};
borgbackup.jobs =
lib.mapAttrs' (name: value: let
snapshot = {

View File

@@ -10,16 +10,6 @@ in {
stateVersion = "23.05";
timeZone = "UTC";
stubPasswords = true;
base.snapshot = {
enable = true;
pools = {
var_lib = {
mountpoint = "/var/lib";
zfs_name = "rpool/nixos/var/lib";
};
};
};
};
environment = {