nixos-config/users/builder/default.nix

26 lines
634 B
Nix
Raw Normal View History

2022-08-18 16:37:26 +02:00
{ pkgs, 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"; };
config = mkIf (cfg.enable) {
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" ];
};
}