Compare commits

..

1 commit

Author SHA1 Message Date
5514618d21
feat(nimbolus): init a http terraform backend
Some checks failed
Check meta / check_dns (pull_request) Successful in 16s
Check workflows / check_workflows (pull_request) Successful in 19s
Build all the nodes / Jaccess01 (pull_request) Successful in 23s
Build all the nodes / Jaccess04 (pull_request) Successful in 26s
Run pre-commit on all files / pre-commit (push) Successful in 29s
Build all the nodes / compute01 (pull_request) Failing after 28s
Run pre-commit on all files / pre-commit (pull_request) Successful in 32s
Build all the nodes / ap01 (pull_request) Successful in 40s
Build all the nodes / netcore01 (pull_request) Successful in 23s
Build all the nodes / hypervisor01 (pull_request) Successful in 54s
Build all the nodes / cof02 (pull_request) Successful in 57s
Build all the nodes / bridge01 (pull_request) Successful in 59s
Build all the nodes / geo01 (pull_request) Successful in 57s
Build all the nodes / geo02 (pull_request) Successful in 58s
Build all the nodes / build01 (pull_request) Successful in 1m2s
Build all the nodes / hypervisor02 (pull_request) Successful in 49s
Build all the nodes / hypervisor03 (pull_request) Successful in 49s
Build all the nodes / netcore02 (pull_request) Successful in 27s
Build all the nodes / lab-router01 (pull_request) Successful in 46s
Build all the nodes / iso (pull_request) Successful in 57s
Build the shell / build-shell (pull_request) Successful in 22s
Build all the nodes / tower01 (pull_request) Successful in 45s
Build all the nodes / web02 (pull_request) Successful in 54s
Build all the nodes / web03 (pull_request) Successful in 1m5s
Build all the nodes / krz01 (pull_request) Successful in 1m45s
Build all the nodes / zulip01 (pull_request) Successful in 1m4s
Build all the nodes / vault01 (pull_request) Successful in 1m14s
Build all the nodes / rescue01 (pull_request) Successful in 1m21s
Build all the nodes / web01 (pull_request) Successful in 1m14s
Build all the nodes / storage01 (pull_request) Successful in 1m21s
2025-06-15 13:37:27 +02:00
5 changed files with 34 additions and 77 deletions

View file

@ -13,26 +13,29 @@ let
port = 9008;
in
{
import = [ ./module.nix ];
services.nimbolus-tf = {
enable = true;
package = (import sources.kat-pkgs { inherit pkgs; }).nimbolus-tf-backend;
environment = {
settings = {
LISTEN_ADDR = "127.0.0.1:${toString port}";
KMS_KEY_PATH = config.age.secrets."nimbolus-kms_key".path;
STORAGE_BACKEND = "s3";
STORAGE_S3_ENDPOINT = "s3.dgnum.eu";
STORAGE_S3_USE_SSL = "true";
STORAGE_S3_BUCKET = "nimbolus-dgnum";
STORAGE_S3_ACCESS_KEY = "GKefa111701f349de3988f0010";
STORAGE_S3_SECRET_KEY_FILE = config.age.secrets."nimbolus-s3_secret".path;
# TODO: configure openBAO
# AUTH_BASIC_ENABLED = "false";
# AUTH_JWT_OIDC_ISSUER_URL = "https://vault.dgnum.eu/v1/identity/oidc";
};
secretEnvironment = {
KMS_KEY = config.age.secrets."nimbolus-kms_key".path;
STORAGE_S3_ACCESS_KEY = config.age.secrets."nimbolus-s3_access".path;
STORAGE_S3_SECRET_KEY = config.age.secrets."nimbolus-s3_secret".path;
};
};
age-secrets.autoMatch = [ "nimbolus" ];
dgn-web.simpleProxies.nimbolus = {
inherit host port;
};

View file

@ -5,83 +5,71 @@
{
lib,
config,
sources,
pkgs,
...
}:
let
inherit (lib)
escapeShellArg
getExe
mapAttrsToList
mkEnableOption
mkIf
mkPackageOption
mkOption
;
inherit (lib.types)
attrsOf
package
path
str
;
# from nixpkgs, commit b1371135b5db3fcf728114d92d5bd0218109598a
# FIXME: Should be replaced by nixpkgs lib when going to nixos-25.05
concatMapAttrsStringSep =
sep: f: attrs:
lib.concatStringsSep sep (lib.attrValues (lib.mapAttrs f attrs));
cfg = config.services.nimbolus-tf;
in
{
options.services.nimbolus-tf = {
enable = mkEnableOption "the nimbolus terraform http backend";
package = mkOption {
type = package;
enable = mkEnableOption "the nimbolus terraform http backend" { pkgsText = "kat-pkgs"; };
package = mkPackageOption (import sources.kat-pkgs { inherit pkgs; }) "nimbolus-tf-backend";
user = mkOption {
type = str;
description = ''
The hello package to use.
User used by the nimbolus server.
'';
example = "kat-pkgs.nimbolus-tf-backend";
default = "nimbolus";
};
environment = mkOption {
group = mkOption {
type = str;
description = ''
Group used by the nimbolus server.
'';
default = "nimbolus";
};
settings = mkOption {
type = attrsOf str;
default = { };
description = ''
Environment variables for nimbolus configuration.
'';
};
secretEnvironment = mkOption {
type = attrsOf path;
default = { };
description = ''
Files for secret environment variables for nimbolus configuration.
'';
};
};
config = mkIf cfg.enable {
users = {
users.${cfg.user}.isSystemUser = true;
groups.${cfg.group} = { };
};
systemd.services."nimbolus-tf" = {
description = "Nimbolus terraform http backend";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
EnvironmentFile = "-/run/nimbolus-tf/env-file";
ExecStart = "${getExe cfg.package}";
ExecStartPre = "+${pkgs.writeShellScript "nimbolus-prestart" ''
echo -n > /run/nimbolus-tf/env-file
${concatMapAttrsStringSep "\n" (
key: value: "echo ${escapeShellArg "${key}=${value}"} >> /run/nimbolus-tf/env-file"
) cfg.environment}
${concatMapAttrsStringSep "\n" (
key: value: ''echo "${key}=$(cat ${value})" >> /run/nimbolus-tf/env-file''
) cfg.secretEnvironment}
chmod a+r /run/nimbolus-tf/env-file
''}";
ExecStart = getExe cfg.package;
Environment = mapAttrsToList (name: value: "${name}=${value}") cfg.settings;
User = cfg.user;
Group = cfg.group;
RuntimeDirectory = "nimbolus-tf";
RuntimeDirectoryMode = "0700";
StateDirectory = "nimbolus-tf";
StateDirectoryMode = "0700";
WorkingDirectory = "/var/lib/nimbolus-tf";
# Hardening
DynamicUser = true;
CapabilityBoundingSet = "";
PrivateDevices = true;
ProtectClock = true;

View file

@ -1,32 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 ZIo4kw POP274mkHkdXwYJ/yaU9li2G2t9p0tAQ0qOQslPFoCA
p5yYZyPRNMYRV9KPM7oMuu1LTTDMrmQ8il0r77Pi4rI
-> ssh-ed25519 9/PCvA o1gN3ulajleNwhPm40inSZluZ09SOuNKIfLr8mB8G08
OMoMGTxI/rwojuWiSgDj5WAU58eOATL5VSkzvsVZuRY
-> ssh-ed25519 prNEsA S3ekdfgp2pf9/jL32HAtuhQKuYPxaWz/lOjD+FkP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jjnr0nN3S7CBkF77EkUYV/yZ0os2H3t3Vy6r2XuxF14
wz6x/Rvqq3oUCYJaGcWIK9xEEY6aZUqnk0Ve7trFfF0
-> ssh-ed25519 tDqJRg RDDHbdgqHh8flC0QO2hwQxX0caS+tbiM8OzIpVrNqBw
yVxHVzLPYd1F3upLpaQzu1d3V7il7aZBocBegL6DdJ4
--- eiwmc9p33AICiJ3GOnfj3n2+gfS39jf0NgD681w8HG4
Ðqo¦ÔÊþ‰/Taï`´­ù<C2AD>Žº—ö?AæBeÌ«ÒÛj |Šâ©¥õœÐWBÈýCˆ<43>©å¿

View file

@ -26,7 +26,6 @@
"nextcloud-adminpass_file"
"nextcloud-s3_secret_file"
"nimbolus-kms_key"
"nimbolus-s3_access"
"nimbolus-s3_secret"
"opengist-environment_file"
"outline-oidc_client_secret_file"

View file

@ -38,7 +38,6 @@
"django-apps"
"extranix"
"forgejo-multiuser-nix-runners"
"nimbolus-tf"
"openbao"
])
++ [