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 # 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"
];
} }