refactor palatine-hill, add some packages to artemision, hypr zoom restart
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
91
systems/palatine-hill/zfs.nix
Normal file
91
systems/palatine-hill/zfs.nix
Normal file
@ -0,0 +1,91 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
bootkey = key: { "/crypto/keys/${key}" = /crypto/keys/${key}; };
|
||||
zfskeys = [
|
||||
"zfs-attic-key"
|
||||
"zfs-backup-key"
|
||||
"zfs-calibre-key"
|
||||
"zfs-db-key"
|
||||
"zfs-docker-key"
|
||||
"zfs-games-key"
|
||||
"zfs-hydra-key"
|
||||
"zfs-libvirt-key"
|
||||
"zfs-main-key"
|
||||
"zfs-nxtcld-key"
|
||||
"zfs-torr-key"
|
||||
"zfs-var-docker-key"
|
||||
"zfs-nix-store-key"
|
||||
];
|
||||
in
|
||||
{
|
||||
boot = {
|
||||
zfs.extraPools = [ "ZFS-primary" ];
|
||||
filesystem = "zfs";
|
||||
initrd.secrets = lib.mergeAttrsList (map bootkey zfskeys);
|
||||
extraModprobeConfig = ''
|
||||
options zfs zfs_arc_min=82463372083
|
||||
options zfs zfs_arc_max=192414534860
|
||||
'';
|
||||
};
|
||||
|
||||
services = {
|
||||
zfs = {
|
||||
trim.enable = true;
|
||||
autoScrub.enable = true;
|
||||
};
|
||||
|
||||
sanoid = {
|
||||
enable = true;
|
||||
|
||||
datasets = {
|
||||
"ZFS-primary/attic".useTemplate = [ "nix-prod" ];
|
||||
"ZFS-primary/backups".useTemplate = [ "production" ];
|
||||
"ZFS-primary/calibre".useTemplate = [ "production" ];
|
||||
"ZFS-primary/db".useTemplate = [ "production" ];
|
||||
"ZFS-primary/docker".useTemplate = [ "production" ];
|
||||
"ZFS-primary/hydra".useTemplate = [ "nix-prod" ];
|
||||
"ZFS-primary/nextcloud".useTemplate = [ "production" ];
|
||||
"ZFS-primary/vardocker".useTemplate = [ "production" ];
|
||||
"ZFS-primary/games" = {
|
||||
useTemplate = [ "games" ];
|
||||
recursive = true;
|
||||
processChildrenOnly = true;
|
||||
};
|
||||
};
|
||||
|
||||
templates = {
|
||||
# full resiliency
|
||||
production = {
|
||||
frequently = 0;
|
||||
hourly = 36;
|
||||
daily = 30;
|
||||
monthly = 6;
|
||||
yearly = 3;
|
||||
autosnap = true;
|
||||
autoprune = true;
|
||||
};
|
||||
# some resiliency, but not much
|
||||
# common option for things like nix store and attic where there is
|
||||
# already a lot of resiliency built in
|
||||
nix-prod = {
|
||||
frequently = 4;
|
||||
hourly = 24;
|
||||
daily = 7;
|
||||
};
|
||||
# much shorter lived than others
|
||||
games = {
|
||||
frequently = 6;
|
||||
hourly = 36;
|
||||
daily = 3;
|
||||
autosnap = true;
|
||||
autoprune = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user