Merge remote-tracking branch 'mors/master'

This commit is contained in:
tv 2015-08-14 15:51:29 +02:00
commit b8b2575d83
2 changed files with 11 additions and 12 deletions

View File

@ -310,9 +310,11 @@ let
users = addNames { users = addNames {
lass = { lass = {
pubkey = readFile ../../Zpubkeys/lass.ssh.pub; pubkey = readFile ../../Zpubkeys/lass.ssh.pub;
mail = "lass@mors.retiolum";
}; };
uriel = { uriel = {
pubkey = readFile ../../Zpubkeys/uriel.ssh.pub; pubkey = readFile ../../Zpubkeys/uriel.ssh.pub;
mail = "uriel@mors.retiolum";
}; };
}; };
}; };

View File

@ -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,23 +84,21 @@ 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 else
if perm.recursive then "chmod ${perm.permission} ${perm.path}"
"chmod -R ${perm.permission} ${perm.path}"
else
"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 else
if perm.recursive then "chown ${perm.owner} ${perm.path}"
"chown -R ${perm.owner} ${perm.path}"
else
"chown ${perm.owner} ${perm.path}"
; ;
in out in out