nixos-config/users/builder/default.nix

26 lines
626 B
Nix
Raw Normal View History

{ config, lib, ... }:
2022-08-14 16:38:25 +02:00
with lib;
let
cfg = config.eboskma.users.builder;
authorizedKeys = builtins.map (key: (builtins.readFile (./keys/${key})))
(builtins.attrNames (builtins.readDir ./keys));
in
{
options.eboskma.users.builder = { enable = mkEnableOption "builder"; };
2022-10-05 11:32:13 +02:00
config = mkIf cfg.enable {
2022-08-14 16:38:25 +02:00
users.users.builder = {
isSystemUser = true;
group = "builder";
useDefaultShell = true;
home = "/var/lib/builder";
createHome = true;
openssh.authorizedKeys.keys = authorizedKeys;
};
2022-08-18 16:37:26 +02:00
users.groups.builder = { };
2022-08-14 16:38:25 +02:00
nix.settings.trusted-users = [ "builder" ];
};
}