Skip to content
This repository was archived by the owner on Sep 14, 2025. It is now read-only.

Commit 8d61242

Browse files
committed
netbox: add package option to apply oidc pipeline
1 parent a38eb10 commit 8d61242

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

modules/netbox/default.nix

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111

1212
options.secshell.netbox = {
1313
enable = lib.mkEnableOption "netbox";
14+
package = lib.mkPackageOption pkgs-unstable "netbox" { } // {
15+
apply =
16+
pkg:
17+
if config.secshell.netbox.oidc.endpoint != "" then
18+
pkg.overrideAttrs (old: {
19+
installPhase =
20+
old.installPhase
21+
+ ''
22+
ln -s ${./pipeline.py} $out/opt/netbox/netbox/netbox/secshell_pipeline.py
23+
'';
24+
})
25+
else
26+
pkg;
27+
};
1428
domain = lib.mkOption {
1529
type = lib.types.str;
1630
default = "netbox.${toString config.networking.fqdn}";
@@ -83,17 +97,7 @@
8397

8498
netbox = {
8599
enable = true;
86-
package =
87-
if config.secshell.netbox.oidc.endpoint != "" then
88-
pkgs-unstable.netbox.overrideAttrs (old: {
89-
installPhase =
90-
old.installPhase
91-
+ ''
92-
ln -s ${./pipeline.py} $out/opt/netbox/netbox/netbox/secshell_pipeline.py
93-
'';
94-
})
95-
else
96-
pkgs-unstable.netbox;
100+
package = config.secshell.netbox.package;
97101
secretKeyFile = config.sops.secrets."netbox/secretKey".path;
98102
port = config.secshell.netbox.internal_port;
99103
listenAddress = "127.0.0.1";

0 commit comments

Comments
 (0)