nix-config/machines/porthos/users.nix
Bruno BELANYI 340906d6b2 porthos: users: add 'ambroisie' to 'media'
This only done when the groups exists.
2021-02-25 15:29:06 +00:00

25 lines
559 B
Nix

# User setup
{ 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 = {
description = "Blog Publisher";
isNormalUser = true;
group = "nginx";
createHome = false; # Messes with permissions
home = "/var/www/";
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
};
users.users.ambroisie.extraGroups = groupsIfExist [
"media"
];
}