move filesystem imports to module level

This commit is contained in:
2025-07-16 23:20:28 +02:00
parent 57ba310000
commit 21e54d968e
4 changed files with 62 additions and 12 deletions

46
zfs-management.nix Normal file
View File

@@ -0,0 +1,46 @@
{ config, pkgs, ... }:
{
# Add ZFS and NFS support to the initramfs so it can be mounted at boot.
boot.supportedFilesystems = [ "zfs" "nfs" ];
# boot.zfs.enableUnstable = true;
boot.zfs.forceImportRoot = false;
# boot.zfs.extraPools = [ "DATA" ];
services.zfs.autoScrub.enable = true;
# Enable and configure zrepl service
environment.systemPackages = [ pkgs.zrepl ];
services.zrepl = {
enable = true;
settings = {
global = {
logging = [{
# use syslog instead of stdout because it makes journald happy
type = "syslog";
format = "human";
level = "info";
}];
};
jobs = [{
type = "source";
name = "pullsource";
send = {
encrypted = true;
};
serve = {
type = "stdinserver";
client_identities = [ "siredward" ];
};
filesystems = {
"SERVICE/volumes" = true;
};
snapshotting = {
type = "periodic";
prefix = "SN_";
interval = "1h";
};
}];
};
};
}