lass 3 folderPerms: remove recursive option
This commit is contained in:
parent
f5fa77fb73
commit
f36177cf91
@ -1,5 +1,8 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
#TODO: implement recursive mode maybe?
|
||||||
|
# enable different mods for files and folders
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs)
|
inherit (pkgs)
|
||||||
writeScript
|
writeScript
|
||||||
@ -45,10 +48,6 @@ let
|
|||||||
'';
|
'';
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
recursive = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
@ -85,21 +84,19 @@ let
|
|||||||
];
|
];
|
||||||
|
|
||||||
buildPermission = perm:
|
buildPermission = perm:
|
||||||
|
#TODO: create folder maybe
|
||||||
|
#TODO: check if permission is valid
|
||||||
if (perm.permission == null) then
|
if (perm.permission == null) then
|
||||||
""
|
""
|
||||||
else
|
|
||||||
if perm.recursive then
|
|
||||||
"chmod -R ${perm.permission} ${perm.path}"
|
|
||||||
else
|
else
|
||||||
"chmod ${perm.permission} ${perm.path}"
|
"chmod ${perm.permission} ${perm.path}"
|
||||||
;
|
;
|
||||||
|
|
||||||
buildOwner = perm:
|
buildOwner = perm:
|
||||||
|
#TODO: create folder maybe
|
||||||
|
#TODO: check if owner/group valid
|
||||||
if (perm.owner == null) then
|
if (perm.owner == null) then
|
||||||
""
|
""
|
||||||
else
|
|
||||||
if perm.recursive then
|
|
||||||
"chown -R ${perm.owner} ${perm.path}"
|
|
||||||
else
|
else
|
||||||
"chown ${perm.owner} ${perm.path}"
|
"chown ${perm.owner} ${perm.path}"
|
||||||
;
|
;
|
||||||
|
Loading…
Reference in New Issue
Block a user