mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
feat: refactoring + system types
This commit is contained in:
parent
a0f9d0ab48
commit
9794026f6c
36 changed files with 653 additions and 537 deletions
23
modules/tf/acme.nix
Normal file
23
modules/tf/acme.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ config, meta, lib, target, ... }: with lib;
|
||||
let
|
||||
home = meta.deploy.targets.home.tf;
|
||||
in lib.mkIf (target != "home") {
|
||||
acme = {
|
||||
enable = true;
|
||||
account = {
|
||||
register = lib.mkDefault false;
|
||||
emailAddress = "kat@inskip.me";
|
||||
accountKeyPem = home.resources.acme_private_key.importAttr "private_key_pem";
|
||||
};
|
||||
challenge = {
|
||||
defaultProvider = "rfc2136";
|
||||
configs.rfc2136 = {
|
||||
RFC2136_NAMESERVER = config.variables.katdns-address.ref;
|
||||
RFC2136_TSIG_KEY = config.variables.katdns-name.ref;
|
||||
RFC2136_TSIG_SECRET = config.variables.katdns-key.ref;
|
||||
RFC2136_TSIG_ALGORITHM = "hmac-sha512";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
3
modules/tf/gcroot.nix
Normal file
3
modules/tf/gcroot.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{ config, ... }: {
|
||||
deploy.gcroot.enable = true;
|
||||
}
|
||||
31
modules/tf/katdns.nix
Normal file
31
modules/tf/katdns.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{ config, lib, ... }: with lib; {
|
||||
variables.katdns-address = {
|
||||
value.shellCommand = "${meta.kw.secrets.command} secrets/katdns -f address";
|
||||
type = "string";
|
||||
sensitive = true;
|
||||
};
|
||||
variables.katdns-name = {
|
||||
value.shellCommand = "${meta.kw.secrets.command} secrets/katdns -f username";
|
||||
type = "string";
|
||||
sensitive = true;
|
||||
};
|
||||
variables.katdns-key = {
|
||||
value.shellCommand = "${meta.kw.secrets.command} secrets/katdns -f password";
|
||||
type = "string";
|
||||
sensitive = true;
|
||||
};
|
||||
|
||||
providers.katdns = {
|
||||
type = "dns";
|
||||
inputs.update = {
|
||||
server = config.variables.katdns-address.ref;
|
||||
key_name = config.variables.katdns-name.ref;
|
||||
key_secret = config.variables.katdns-key.ref;
|
||||
key_algorithm = "hmac-sha512";
|
||||
};
|
||||
};
|
||||
|
||||
dns.zones = genAttrs [ "inskip.me." "kittywit.ch." "dork.dev." "gensokyo.zone." ] (_: {
|
||||
provider = "dns.katdns";
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue