nix: add sanoid module + enable on loki,t14
This commit is contained in:
parent
bac5f3e9e7
commit
fdb22c1152
@ -21,6 +21,7 @@
|
||||
|
||||
../../modules/base.nix
|
||||
../../modules/dnscrypt.nix
|
||||
../../modules/sanoid.nix
|
||||
../../modules/uptime-kuma.nix
|
||||
../../modules/zram.nix
|
||||
];
|
||||
@ -195,6 +196,39 @@
|
||||
];
|
||||
};
|
||||
|
||||
sanoid = {
|
||||
enable = true;
|
||||
interval = "*:0/5";
|
||||
datasets = {
|
||||
"zroot/DATA/services/nextcloud" = {
|
||||
useTemplate = ["frequent"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
"zroot/DATA/services/gonic" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
"zroot/DATA/services/attic" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
"zroot/DATA/services/uptime-kuma" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
# rootfs.
|
||||
"zroot/ROOT/nixos" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
# nix stuff, just to make sure.
|
||||
"zroot/nix" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# TS is enabled in the imported module, this is additional config.
|
||||
tailscale = {
|
||||
useRoutingFeatures = "both";
|
||||
|
@ -14,6 +14,7 @@
|
||||
../../modules/base.nix
|
||||
../../modules/dnscrypt.nix
|
||||
../../modules/firejail.nix
|
||||
../../modules/sanoid.nix
|
||||
../../modules/zram.nix
|
||||
];
|
||||
|
||||
@ -333,6 +334,27 @@
|
||||
];
|
||||
};
|
||||
|
||||
sanoid = {
|
||||
enable = true;
|
||||
interval = "*:0/5";
|
||||
datasets = {
|
||||
"zroot/userdata" = {
|
||||
useTemplate = ["frequent"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
"zroot/system/nixos" = {
|
||||
useTemplate = ["production"];
|
||||
recursive = "zfs";
|
||||
};
|
||||
"zroot/local/nix" = {
|
||||
useTemplate = ["production"];
|
||||
};
|
||||
"zroot/local/xper" = {
|
||||
useTemplate = ["production"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
syncthing = {
|
||||
enable = true;
|
||||
openDefaultPorts = true;
|
||||
|
45
nix/modules/sanoid.nix
Normal file
45
nix/modules/sanoid.nix
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.sanoid = {
|
||||
templates = {
|
||||
production = {
|
||||
frequently = 5;
|
||||
hourly = 96;
|
||||
daily = 30;
|
||||
monthly = 3;
|
||||
yearly = 0;
|
||||
autosnap = true;
|
||||
autoprune = true;
|
||||
};
|
||||
|
||||
frequent = {
|
||||
frequently = 90;
|
||||
frequent_period = 5;
|
||||
hourly = 96;
|
||||
daily = 30;
|
||||
monthly = 3;
|
||||
yearly = 0;
|
||||
autosnap = true;
|
||||
autoprune = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.sanoid.timerConfig = {
|
||||
Persistent = true;
|
||||
# WantedBy =["timers.target"];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mbuffer
|
||||
zstd
|
||||
];
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOrlXIj3oWbWrFUZnhccd/uqM2D/yRiKOEwfD6xbngJ7 syncoid pull backups"
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue
Block a user