remote-builder
This commit is contained in:
parent
731f0155d6
commit
861d4e81fc
2
data.nix
2
data.nix
|
@ -16,6 +16,8 @@ rec {
|
|||
jakstpub = 505;
|
||||
|
||||
photoprism = 507;
|
||||
|
||||
remote-builder = 508;
|
||||
};
|
||||
|
||||
ports = {
|
||||
|
|
|
@ -70,6 +70,16 @@
|
|||
sshguard.enable = true;
|
||||
tailscale.enable = true;
|
||||
|
||||
remote-builder = {
|
||||
enable = true;
|
||||
uidgid = myData.uidgid.remote-builder;
|
||||
sshAllowSubnet = myData.subnets.tailscale.sshPattern;
|
||||
publicKeys = map (h: myData.hosts.${h}.publicKey) [
|
||||
"vno1-oh2.servers.jakst"
|
||||
"fwminex.motiejus.jakst"
|
||||
];
|
||||
};
|
||||
|
||||
postfix = {
|
||||
enable = true;
|
||||
saslPasswdPath = config.age.secrets.sasl-passwd.path;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
./node_exporter
|
||||
./nsd-acme
|
||||
./postfix
|
||||
./remote-builder
|
||||
./snmp_exporter
|
||||
./sshguard
|
||||
./syncthing
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.mj.services.remote-builder;
|
||||
in {
|
||||
options.mj.services.remote-builder = with lib.types; {
|
||||
enable = lib.mkEnableOption "Enable remote builder";
|
||||
uidgid = lib.mkOption {type = int;};
|
||||
sshAllowSubnet = lib.mkOption {type = str;};
|
||||
publicKeys = lib.mkOption {type = listOf str;};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.remote-builder = {
|
||||
description = "Remote Builder";
|
||||
home = "/var/lib/remote-builder";
|
||||
shell = "/bin/sh";
|
||||
group = "remote-builder";
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
uid = cfg.uidgid;
|
||||
openssh.authorizedKeys.keys =
|
||||
map (
|
||||
k: "from=\"${cfg.sshAllowSubnet}\" ${k}"
|
||||
)
|
||||
cfg.publicKeys;
|
||||
};
|
||||
users.groups.remote-builder.gid = cfg.uidgid;
|
||||
nix.settings.trusted-users = ["remote-builder"];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue