porthos: users: add 'ambroisie' to 'media'

This only done when the groups exists.
This commit is contained in:
Bruno BELANYI 2021-02-10 23:37:20 +00:00
parent 866225393b
commit 340906d6b2

View file

@ -1,7 +1,12 @@
# User setup
{ config, ... }:
{ config, lib, ... }:
let
my = config.my;
groupIfExists = grp:
lib.lists.optional
(builtins.hasAttr grp config.users.groups)
grp;
groupsIfExist = grps: builtins.concatMap groupIfExists grps;
in
{
users.users.blog = {
@ -12,4 +17,8 @@ in
home = "/var/www/";
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
};
users.users.ambroisie.extraGroups = groupsIfExist [
"media"
];
}