Compare commits
2 commits
c2bafcbc65
...
22fb460650
Author | SHA1 | Date | |
---|---|---|---|
|
22fb460650 | ||
|
39d1d2999b |
3 changed files with 38 additions and 11 deletions
19
hive.nix
19
hive.nix
|
@ -16,21 +16,23 @@ let
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixpkgs =
|
mkPatchedNixpkgs =
|
||||||
node:
|
version:
|
||||||
patch.mkNixpkgsSrc rec {
|
patch.mkNixpkgsSrc {
|
||||||
src = sources.${version};
|
src = sources.${version};
|
||||||
version = "nixos-${nodes'.${node}.nixpkgs or (import ./meta/nixpkgs.nix)}";
|
inherit version;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkNixpkgs' = node: import (mkNixpkgs node) { };
|
mkNixpkgs = version: import (mkPatchedNixpkgs version) { };
|
||||||
|
|
||||||
|
mkNixpkgsVersion = node: "nixos-${nodes'.${node}.nixpkgs or (import ./meta/nixpkgs.nix)}";
|
||||||
|
|
||||||
###
|
###
|
||||||
# Function to create arguments based on the node
|
# Function to create arguments based on the node
|
||||||
#
|
#
|
||||||
mkArgs = node: rec {
|
mkArgs = node: rec {
|
||||||
lib = import sources.nix-lib {
|
lib = import sources.nix-lib {
|
||||||
inherit (mkNixpkgs' node) lib;
|
inherit (mkNixpkgs (mkNixpkgsVersion node)) lib;
|
||||||
|
|
||||||
keysRoot = ./keys;
|
keysRoot = ./keys;
|
||||||
};
|
};
|
||||||
|
@ -41,10 +43,11 @@ in
|
||||||
# nodes = builtins.attrNames metadata.nodes;
|
# nodes = builtins.attrNames metadata.nodes;
|
||||||
{
|
{
|
||||||
meta = {
|
meta = {
|
||||||
nodeNixpkgs = lib.mapSingleFuse mkNixpkgs' nodes;
|
nodeNixpkgs = lib.mapSingleFuse (n: mkNixpkgs (mkNixpkgsVersion n)) nodes;
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit sources;
|
inherit sources;
|
||||||
|
inherit mkNixpkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
nodeSpecialArgs = lib.mapSingleFuse mkArgs nodes;
|
nodeSpecialArgs = lib.mapSingleFuse mkArgs nodes;
|
||||||
|
@ -63,7 +66,7 @@ in
|
||||||
inherit (meta.nodes.${name}) deployment;
|
inherit (meta.nodes.${name}) deployment;
|
||||||
|
|
||||||
# Set NIX_PATH to the patched version of nixpkgs
|
# Set NIX_PATH to the patched version of nixpkgs
|
||||||
nix.nixPath = [ "nixpkgs=${mkNixpkgs name}" ];
|
nix.nixPath = [ "nixpkgs=${mkPatchedNixpkgs (mkNixpkgsVersion name)}" ];
|
||||||
nix.optimise.automatic = true;
|
nix.optimise.automatic = true;
|
||||||
|
|
||||||
# Allow unfree packages
|
# Allow unfree packages
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
sources,
|
|
||||||
lib,
|
lib,
|
||||||
|
mkNixpkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -13,12 +13,20 @@ in
|
||||||
services = {
|
services = {
|
||||||
netbox = {
|
netbox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = (import sources.nixos-unstable { }).pkgs.netbox_3_7;
|
package = (mkNixpkgs "nixos-unstable").netbox_3_7;
|
||||||
secretKeyFile = "/dev/null";
|
secretKeyFile = "/dev/null";
|
||||||
listenAddress = "127.0.0.1";
|
listenAddress = "127.0.0.1";
|
||||||
|
plugins = p: [ p.netbox-qrcode ];
|
||||||
settings = {
|
settings = {
|
||||||
ALLOWED_HOSTS = [ "netbox.dgnum.eu" ];
|
ALLOWED_HOSTS = [ "netbox.dgnum.eu" ];
|
||||||
REMOTE_AUTH_BACKEND = "social_core.backends.open_id_connect.OpenIdConnectAuth";
|
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 ''
|
extraConfig = lib.mkForce ''
|
||||||
|
|
|
@ -16,6 +16,13 @@ in
|
||||||
hash = "sha256-mjeRxtZozgLNzHkCxcTs3xnonNPkmPoaGxawixC9jfo=";
|
hash = "sha256-mjeRxtZozgLNzHkCxcTs3xnonNPkmPoaGxawixC9jfo=";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# netbox qrcode plugin
|
||||||
|
{
|
||||||
|
_type = "commit";
|
||||||
|
sha = "ae4bf4c110378ebacb3989c9533726859cfebbfa";
|
||||||
|
hash = "sha256-SgHhW9HCkDQsxT3eG4P9q68c43e3sbDHRY9qs7oSt8o=";
|
||||||
|
}
|
||||||
|
|
||||||
netboxAgent
|
netboxAgent
|
||||||
|
|
||||||
# missing jsonargparse deps for netbox-agent
|
# missing jsonargparse deps for netbox-agent
|
||||||
|
@ -144,5 +151,14 @@ in
|
||||||
hash = "sha256-XVq72jiLCDrZhADgyvI5y1y/5zlpX89vUBvxUolrYp8=";
|
hash = "sha256-XVq72jiLCDrZhADgyvI5y1y/5zlpX89vUBvxUolrYp8=";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
"nixos-unstable" = [ netboxAgent ];
|
"nixos-unstable" = [
|
||||||
|
netboxAgent
|
||||||
|
|
||||||
|
# netbox qrcode plugin
|
||||||
|
{
|
||||||
|
_type = "commit";
|
||||||
|
sha = "ae4bf4c110378ebacb3989c9533726859cfebbfa";
|
||||||
|
hash = "sha256-SgHhW9HCkDQsxT3eG4P9q68c43e3sbDHRY9qs7oSt8o=";
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue