nix run github:astro/deadnix
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}: let
|
||||
cfg = config.zfs-root.fileSystems;
|
||||
inherit (lib) mkIf types mkDefault mkOption mkMerge mapAttrsToList;
|
||||
inherit (lib) types mkDefault mkOption mkMerge mapAttrsToList;
|
||||
in {
|
||||
options.zfs-root.fileSystems = {
|
||||
datasets = mkOption {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
};
|
||||
extraArgs = ["--verbose"];
|
||||
datasets = let
|
||||
fs_zfs = lib.filterAttrs (n: v: v.fsType == "zfs") config.fileSystems;
|
||||
fs_zfs = lib.filterAttrs (_: v: v.fsType == "zfs") config.fileSystems;
|
||||
mountpoint2fs =
|
||||
builtins.listToAttrs
|
||||
(map (mountpoint: {
|
||||
@@ -32,7 +32,7 @@
|
||||
})
|
||||
config.mj.base.snapshot.mountpoints);
|
||||
s_datasets =
|
||||
lib.mapAttrs' (mountpoint: fs: {
|
||||
lib.mapAttrs' (_mountpoint: fs: {
|
||||
name = fs.device;
|
||||
value = {use_template = ["prod"];};
|
||||
})
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
};
|
||||
programs.mosh.enable = true;
|
||||
programs.ssh.knownHosts = let
|
||||
sshAttrs = lib.genAttrs ["extraHostNames" "publicKey"] (name: null);
|
||||
sshAttrs = lib.genAttrs ["extraHostNames" "publicKey"] (_: null);
|
||||
in
|
||||
lib.mapAttrs (name: cfg: builtins.intersectAttrs sshAttrs cfg) myData.hosts;
|
||||
lib.mapAttrs (_name: cfg: builtins.intersectAttrs sshAttrs cfg) myData.hosts;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
passwd.motiejus or {};
|
||||
|
||||
root = assert lib.assertMsg (passwd ? root) "root password needs to be defined";
|
||||
lib.filterAttrs (n: v: v != null) passwd.root;
|
||||
lib.filterAttrs (_: v: v != null) passwd.root;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
mkPreHook = mountpoint: zfs_name: i: ''
|
||||
mkPreHook = zfs_name: i: ''
|
||||
set -x
|
||||
sleep ${toString i}
|
||||
mkdir "$RUNTIME_DIRECTORY/snapshot"
|
||||
@@ -79,7 +79,7 @@ in {
|
||||
extraArgs = "--remote-path=borg1";
|
||||
compression = "auto,lzma";
|
||||
startAt = attrs.backup_at;
|
||||
preHook = mkPreHook mountpoint fs.device i;
|
||||
preHook = mkPreHook fs.device i;
|
||||
prune.keep = {
|
||||
within = "1d";
|
||||
daily = 7;
|
||||
|
||||
Reference in New Issue
Block a user