From f61a8e56e22846e78d97c806ebc44553f9468d87 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Fri, 23 Feb 2024 11:00:34 +0100 Subject: [PATCH] fix(netbox): pre-commit hooks are supposed to be run.... --- machines/web01/netbox.nix | 36 +++++++++++++------ .../{netbox_env => netbox-environment_file} | 0 machines/web01/secrets/secrets.nix | 2 +- patches/default.nix | 3 +- 4 files changed, 28 insertions(+), 13 deletions(-) rename machines/web01/secrets/{netbox_env => netbox-environment_file} (100%) diff --git a/machines/web01/netbox.nix b/machines/web01/netbox.nix index 72cff6a..ac73e1a 100644 --- a/machines/web01/netbox.nix +++ b/machines/web01/netbox.nix @@ -1,9 +1,19 @@ -{ config, pkgs, sources, lib, ... }: +{ + config, + sources, + lib, + ... +}: + +let + EnvironmentFile = [ config.age.secrets."netbox-environment_file".path ]; +in + { services = { netbox = { enable = true; - package = (import sources.nixos-unstable {}).pkgs.netbox_3_7; + package = (import sources.nixos-unstable { }).pkgs.netbox_3_7; secretKeyFile = "/dev/null"; listenAddress = "127.0.0.1"; settings = { @@ -34,16 +44,20 @@ }; }; - systemd.services.netbox.serviceConfig = { - TimeoutStartSec = 600; - EnvironmentFile = config.age.secrets.netbox_env.path; - }; + systemd.services = { + netbox.serviceConfig = { + inherit EnvironmentFile; - systemd.services.netbox-housekeeping.serviceConfig = { - EnvironmentFile = config.age.secrets.netbox_env.path; - }; - systemd.services.netbox-rq.serviceConfig = { - EnvironmentFile = config.age.secrets.netbox_env.path; + TimeoutStartSec = 600; + }; + + netbox-housekeeping.serviceConfig = { + inherit EnvironmentFile; + }; + + netbox-rq.serviceConfig = { + inherit EnvironmentFile; + }; }; users.users.nginx.extraGroups = [ "netbox" ]; diff --git a/machines/web01/secrets/netbox_env b/machines/web01/secrets/netbox-environment_file similarity index 100% rename from machines/web01/secrets/netbox_env rename to machines/web01/secrets/netbox-environment_file diff --git a/machines/web01/secrets/secrets.nix b/machines/web01/secrets/secrets.nix index 9a3beb5..7bb1163 100644 --- a/machines/web01/secrets/secrets.nix +++ b/machines/web01/secrets/secrets.nix @@ -7,7 +7,7 @@ lib.setDefault { inherit publicKeys; } [ "bupstash-put_key" "matterbridge-config_file" "named-bind_dnskeys_conf" - "netbox_env" + "netbox-environment_file" "ntfy_sh-environment_file" "plausible_admin-user-password-file" "plausible_secret-key-base-file" diff --git a/patches/default.nix b/patches/default.nix index 56ac221..ed69156 100644 --- a/patches/default.nix +++ b/patches/default.nix @@ -1,6 +1,7 @@ { "nixos-23.11" = [ - { _type = "static"; + { + _type = "static"; path = ./netbox.patch; } # castopod: 1.6.4 -> 1.7.0 + ajout du support de loadcredentials