nixos-config/users/builder/default.nix
Erwin Boskma 4cd0f83ce8
Some checks failed
/ check (push) Failing after 2m46s
Run nixfmt
2024-02-05 11:46:52 +01:00

28 lines
636 B
Nix

{ config, lib, ... }:
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;
};
users.groups.builder = { };
nix.settings.trusted-users = [ "builder" ];
};
}