2021-02-07 23:07:20 +01:00
|
|
|
# User setup
|
2021-02-11 00:37:20 +01:00
|
|
|
{ config, lib, ... }:
|
2021-02-07 23:07:20 +01:00
|
|
|
let
|
|
|
|
my = config.my;
|
2021-02-11 00:37:20 +01:00
|
|
|
groupIfExists = grp:
|
|
|
|
lib.lists.optional
|
|
|
|
(builtins.hasAttr grp config.users.groups)
|
|
|
|
grp;
|
|
|
|
groupsIfExist = grps: builtins.concatMap groupIfExists grps;
|
2021-02-07 23:07:20 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
users.users.blog = {
|
|
|
|
description = "Blog Publisher";
|
|
|
|
isNormalUser = true;
|
|
|
|
group = "nginx";
|
2021-02-08 14:53:02 +01:00
|
|
|
createHome = false; # Messes with permissions
|
2021-02-07 23:07:20 +01:00
|
|
|
home = "/var/www/";
|
|
|
|
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
|
|
|
|
};
|
2021-02-11 00:37:20 +01:00
|
|
|
|
|
|
|
users.users.ambroisie.extraGroups = groupsIfExist [
|
|
|
|
"media"
|
|
|
|
];
|
2021-02-07 23:07:20 +01:00
|
|
|
}
|