Skip to content

Commit

Permalink
Merge pull request #282929 from minijackson/netbox-3.7.1
Browse files Browse the repository at this point in the history
Netbox 3.7.1
  • Loading branch information
RaitoBezarius authored Jan 22, 2024
2 parents c119181 + da3587e commit 32a6e22
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 20 deletions.
7 changes: 7 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

`CONFIG_FILE_NAME` includes `bpf_pinning`, `ematch_map`, `group`, `nl_protos`, `rt_dsfield`, `rt_protos`, `rt_realms`, `rt_scopes`, and `rt_tables`.

- `netbox` was updated to v3.7. `services.netbox.package` still defaults
to v3.6 if `stateVersion` is earlier than 24.05. Refer to upstream's breaking
changes [for
v3.7.0](https://github.com/netbox-community/netbox/releases/tag/v3.7.0) and
upgrade NetBox by changing `services.netbox.package`. Database migrations
will be run automatically.

- The executable file names for `firefox-devedition`, `firefox-beta`, `firefox-esr` now matches their package names, which is consistent with the `firefox-*-bin` packages. The desktop entries are also updated so that you can have multiple editions of firefox in your app launcher.

- switch-to-configuration does not directly call systemd-tmpfiles anymore.
Expand Down
19 changes: 12 additions & 7 deletions nixos/modules/services/web-apps/netbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ in {
package = lib.mkOption {
type = lib.types.package;
default =
if lib.versionAtLeast config.system.stateVersion "23.11"
if lib.versionAtLeast config.system.stateVersion "24.05"
then pkgs.netbox_3_7
else if lib.versionAtLeast config.system.stateVersion "23.11"
then pkgs.netbox_3_6
else if lib.versionAtLeast config.system.stateVersion "23.05"
then pkgs.netbox_3_5
else pkgs.netbox_3_3;
defaultText = lib.literalExpression ''
if lib.versionAtLeast config.system.stateVersion "23.11"
if lib.versionAtLeast config.system.stateVersion "24.05"
then pkgs.netbox_3_7
else if lib.versionAtLeast config.system.stateVersion "23.11"
then pkgs.netbox_3_6
else if lib.versionAtLeast config.system.stateVersion "23.05"
then pkgs.netbox_3_5
Expand Down Expand Up @@ -306,12 +310,13 @@ in {
${pkg}/bin/netbox trace_paths --no-input
${pkg}/bin/netbox collectstatic --no-input
${pkg}/bin/netbox remove_stale_contenttypes --no-input
# TODO: remove the condition when we remove netbox_3_3
${lib.optionalString
(lib.versionAtLeast cfg.package.version "3.5.0")
"${pkg}/bin/netbox reindex --lazy"}
${pkg}/bin/netbox reindex --lazy
${pkg}/bin/netbox clearsessions
${pkg}/bin/netbox clearcache
${lib.optionalString
# The clearcache command was removed in 3.7.0:
# https://github.com/netbox-community/netbox/issues/14458
(lib.versionOlder cfg.package.version "3.7.0")
"${pkg}/bin/netbox clearcache"}
echo "${cfg.package.version}" > "$versionFile"
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ in {
netdata = handleTest ./netdata.nix {};
networking.networkd = handleTest ./networking.nix { networkd = true; };
networking.scripted = handleTest ./networking.nix { networkd = false; };
netbox_3_5 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_5; };
netbox_3_6 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_6; };
netbox_3_7 = handleTest ./web-apps/netbox.nix { netbox = pkgs.netbox_3_7; };
netbox-upgrade = handleTest ./web-apps/netbox-upgrade.nix {};
# TODO: put in networking.nix after the test becomes more complete
networkingProxy = handleTest ./networking-proxy.nix {};
Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/web-apps/netbox-upgrade.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ../make-test-python.nix ({ lib, pkgs, ... }: let
oldNetbox = pkgs.netbox_3_5;
newNetbox = pkgs.netbox_3_6;
oldNetbox = pkgs.netbox_3_6;
newNetbox = pkgs.netbox_3_7;
in {
name = "netbox-upgrade";

Expand Down
19 changes: 10 additions & 9 deletions pkgs/servers/web-apps/netbox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@ let
generic = import ./generic.nix;
in
lib.fix (self: {
netbox = self.netbox_3_6;
netbox = self.netbox_3_7;

netbox_3_5 = callPackage generic {
version = "3.5.9";
hash = "sha256-CJbcuCyTuihDXrObSGyJi2XF+zgWAwcJzjxtkX8pmKs=";
netbox_3_6 = callPackage generic {
version = "3.6.9";
hash = "sha256-R/hcBKrylW3GnEy10DkrLVr8YJtsSCvCP9H9LhafO9I=";
extraPatches = [
# Allow setting the STATIC_ROOT from within the configuration and setting a custom redis URL
./config.patch
];
tests = {
netbox = nixosTests.netbox_3_5;
netbox = nixosTests.netbox_3_6;
inherit (nixosTests) netbox-upgrade;
};

maintainers = with lib.maintainers; [ minijackson n0emis raitobezarius ];
eol = true;
};

netbox_3_6 = callPackage generic {
version = "3.6.9";
hash = "sha256-R/hcBKrylW3GnEy10DkrLVr8YJtsSCvCP9H9LhafO9I=";
netbox_3_7 = callPackage generic {
version = "3.7.1";
hash = "sha256-hAwkrrjrV+XVIYe3C8f/342SPlllXUhiFuaAp+TLMUw=";
extraPatches = [
# Allow setting the STATIC_ROOT from within the configuration and setting a custom redis URL
./config.patch
./fix-doc-link.patch
];
tests = {
netbox = nixosTests.netbox_3_6;
netbox = nixosTests.netbox_3_7;
inherit (nixosTests) netbox-upgrade;
};

Expand Down
10 changes: 10 additions & 0 deletions pkgs/servers/web-apps/netbox/fix-doc-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/docs/plugins/development/data-backends.md b/docs/plugins/development/data-backends.md
index feffa5bed..8b7226a41 100644
--- a/docs/plugins/development/data-backends.md
+++ b/docs/plugins/development/data-backends.md
@@ -20,4 +20,4 @@ backends = [MyDataBackend]
!!! tip
The path to the list of search indexes can be modified by setting `data_backends` in the PluginConfig instance.

-::: core.data_backends.DataBackend
+::: netbox.data_backends.DataBackend
1 change: 1 addition & 0 deletions pkgs/servers/web-apps/netbox/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
pillow
psycopg2
pyyaml
requests
sentry-sdk
social-auth-core
social-auth-app-django
Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ mapAliases ({

net_snmp = throw "'net_snmp' has been renamed to/replaced by 'net-snmp'"; # Converted to throw 2023-09-10
netbox_3_3 = throw "netbox 3.3 series has been removed as it was EOL"; # Added 2023-09-02
netbox_3_5 = throw "netbox 3.5 series has been removed as it was EOL"; # Added 2024-01-22
nextcloud25 = throw ''
Nextcloud v25 has been removed from `nixpkgs` as the support for is dropped
by upstream in 2023-10. Please upgrade to at least Nextcloud v26 by declaring
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11133,7 +11133,7 @@ with pkgs;
netbootxyz-efi = callPackage ../tools/misc/netbootxyz-efi { };

inherit (callPackage ../servers/web-apps/netbox { })
netbox netbox_3_5 netbox_3_6;
netbox netbox_3_6 netbox_3_7;

netbox2netshot = callPackage ../tools/admin/netbox2netshot { };

Expand Down

0 comments on commit 32a6e22

Please sign in to comment.