porthos: users: add 'ambroisie' to 'media'
This only done when the groups exists.
This commit is contained in:
parent
866225393b
commit
340906d6b2
|
@ -1,7 +1,12 @@
|
||||||
# User setup
|
# User setup
|
||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
my = config.my;
|
my = config.my;
|
||||||
|
groupIfExists = grp:
|
||||||
|
lib.lists.optional
|
||||||
|
(builtins.hasAttr grp config.users.groups)
|
||||||
|
grp;
|
||||||
|
groupsIfExist = grps: builtins.concatMap groupIfExists grps;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
users.users.blog = {
|
users.users.blog = {
|
||||||
|
@ -12,4 +17,8 @@ in
|
||||||
home = "/var/www/";
|
home = "/var/www/";
|
||||||
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
|
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.users.ambroisie.extraGroups = groupsIfExist [
|
||||||
|
"media"
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue