certget
This commit is contained in:
parent
70e5230611
commit
95c4f94a25
2
data.nix
2
data.nix
@ -14,6 +14,8 @@ rec {
|
||||
borgstor = 504;
|
||||
|
||||
jakstpub = 505;
|
||||
|
||||
certget = 506;
|
||||
};
|
||||
|
||||
ports = {
|
||||
|
@ -72,6 +72,12 @@
|
||||
silenceLogs = true;
|
||||
};
|
||||
|
||||
certget = {
|
||||
enable = true;
|
||||
uidgid = myData.uidgid.certget;
|
||||
sshKeys = [myData.hosts."vno1-oh2.servers.jakst".publicKey];
|
||||
};
|
||||
|
||||
borgstor = {
|
||||
enable = true;
|
||||
dataDir = "/data/borg";
|
||||
|
32
modules/services/certget/default.nix
Normal file
32
modules/services/certget/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.mj.services.certget;
|
||||
in {
|
||||
options.mj.services.certget = with lib.types; {
|
||||
enable = lib.mkEnableOption "receive acme certs from somewhere";
|
||||
uidgid = lib.mkOption {type = int;};
|
||||
sshKeys = lib.mkOption {type = listOf str;};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
users.users.certget = {
|
||||
description = "Cert Getter";
|
||||
home = "/var/lib/certget";
|
||||
shell = "/bin/sh";
|
||||
group = "certget";
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
uid = cfg.uidgid;
|
||||
openssh.authorizedKeys.keys =
|
||||
map (
|
||||
k: "command=\"${pkgs.rrsync}/bin/rrsync /var/lib/certget\",restrict ${k}"
|
||||
)
|
||||
cfg.sshKeys;
|
||||
};
|
||||
users.groups.certget.gid = cfg.uidgid;
|
||||
};
|
||||
}
|
@ -6,6 +6,7 @@
|
||||
}: {
|
||||
imports = [
|
||||
./borgstor
|
||||
./certget
|
||||
./deployerbot
|
||||
./friendlyport
|
||||
./gitea
|
||||
|
@ -118,8 +118,7 @@ in {
|
||||
cfg = config.mj.services.deployerbot.follower;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
users.users = {
|
||||
deployerbot-follower = {
|
||||
users.users.deployerbot-follower = {
|
||||
description = "Deployerbot Follower";
|
||||
home = "/var/lib/deployerbot-follower";
|
||||
shell = "/bin/sh";
|
||||
@ -132,7 +131,6 @@ in {
|
||||
restrictedPubKey = "from=\"${builtins.concatStringsSep "," cfg.sshAllowSubnets}\" " + cfg.publicKey;
|
||||
in [restrictedPubKey];
|
||||
};
|
||||
};
|
||||
users.groups.deployerbot-follower.gid = cfg.uidgid;
|
||||
nix.settings.trusted-users = ["deployerbot-follower"];
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user