nixos-config/users/builder/default.nix

29 lines
636 B
Nix
Raw Normal View History

{ config, lib, ... }:
2022-08-14 16:38:25 +02:00
with lib;
let
cfg = config.eboskma.users.builder;
2024-02-05 11:46:52 +01:00
authorizedKeys = builtins.map (key: (builtins.readFile (./keys/${key}))) (
builtins.attrNames (builtins.readDir ./keys)
);
2022-08-14 16:38:25 +02:00
in
{
2024-02-05 11:46:52 +01:00
options.eboskma.users.builder = {
enable = mkEnableOption "builder";
};
2022-08-14 16:38:25 +02:00
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" ];
};
}