From 22fb460650193635ecd117be472dbe84085aefcc Mon Sep 17 00:00:00 2001 From: sinavir Date: Wed, 3 Apr 2024 19:31:46 +0200 Subject: [PATCH] feat(netbox): Add qr-codes --- machines/web01/netbox.nix | 12 ++++++++++-- patches/default.nix | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/machines/web01/netbox.nix b/machines/web01/netbox.nix index 288fd08..971661d 100644 --- a/machines/web01/netbox.nix +++ b/machines/web01/netbox.nix @@ -1,7 +1,7 @@ { config, - sources, lib, + mkNixpkgs, ... }: @@ -13,12 +13,20 @@ in services = { netbox = { enable = true; - package = (import sources.nixos-unstable { }).pkgs.netbox_3_7; + package = (mkNixpkgs "nixos-unstable").netbox_3_7; secretKeyFile = "/dev/null"; listenAddress = "127.0.0.1"; + plugins = p: [ p.netbox-qrcode ]; settings = { ALLOWED_HOSTS = [ "netbox.dgnum.eu" ]; REMOTE_AUTH_BACKEND = "social_core.backends.open_id_connect.OpenIdConnectAuth"; + PLUGINS = [ "netbox_qrcode" ]; + PLUGINS_CONFIG = { + netbox_qrcode = { + custom_text = "DGNum. contact@dgnum.eu"; + text_location = "down"; + }; + }; }; extraConfig = lib.mkForce '' diff --git a/patches/default.nix b/patches/default.nix index 93ea288..759b774 100644 --- a/patches/default.nix +++ b/patches/default.nix @@ -16,6 +16,13 @@ in hash = "sha256-mjeRxtZozgLNzHkCxcTs3xnonNPkmPoaGxawixC9jfo="; } + # netbox qrcode plugin + { + _type = "commit"; + sha = "ae4bf4c110378ebacb3989c9533726859cfebbfa"; + hash = "sha256-SgHhW9HCkDQsxT3eG4P9q68c43e3sbDHRY9qs7oSt8o="; + } + netboxAgent # missing jsonargparse deps for netbox-agent @@ -144,5 +151,14 @@ in hash = "sha256-XVq72jiLCDrZhADgyvI5y1y/5zlpX89vUBvxUolrYp8="; } ]; - "nixos-unstable" = [ netboxAgent ]; + "nixos-unstable" = [ + netboxAgent + + # netbox qrcode plugin + { + _type = "commit"; + sha = "ae4bf4c110378ebacb3989c9533726859cfebbfa"; + hash = "sha256-SgHhW9HCkDQsxT3eG4P9q68c43e3sbDHRY9qs7oSt8o="; + } + ]; }