impermanence: simplify dir-acl handling by using a helper

This commit is contained in:
colin 2023-01-04 01:19:22 +00:00
parent a9ee26388c
commit 829680fb00
2 changed files with 5 additions and 5 deletions

View File

@ -165,10 +165,8 @@ in
backing-path = path.concat [ store.mountpt store-rel-path ];
# pass through the perm/mode overrides
dir-acl = {
user = lib.mkIf (opt.user != null) opt.user;
group = lib.mkIf (opt.group != null) opt.group;
mode = lib.mkIf (opt.mode != null) opt.mode;
dir-acl = sane-lib.filterNonNull {
inherit (opt) user group mode;
};
in {
# create destination and backing directory, with correct perms

View File

@ -1,6 +1,8 @@
{ ... }@moduleArgs:
{ lib, ... }@moduleArgs:
{
path = import ./path.nix moduleArgs;
types = import ./types.nix moduleArgs;
filterNonNull = attrs: lib.filterAttrsRecursive (n: v: v != null) attrs;
}