impermanence: simplify dir-acl handling by using a helper
This commit is contained in:
parent
a9ee26388c
commit
829680fb00
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user