diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 790b54fdd4ccf..00fbe68ee623a 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -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. diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index 72ec578146a76..d034f3234a2bd 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -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 @@ -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" ''; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4b6696e4fdbf3..1453a3875f6e7 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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 {}; diff --git a/nixos/tests/web-apps/netbox-upgrade.nix b/nixos/tests/web-apps/netbox-upgrade.nix index b5403eb678bcb..4c554e7ae613b 100644 --- a/nixos/tests/web-apps/netbox-upgrade.nix +++ b/nixos/tests/web-apps/netbox-upgrade.nix @@ -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"; diff --git a/pkgs/servers/web-apps/netbox/default.nix b/pkgs/servers/web-apps/netbox/default.nix index 245c7591dc735..ea29815974960 100644 --- a/pkgs/servers/web-apps/netbox/default.nix +++ b/pkgs/servers/web-apps/netbox/default.nix @@ -3,17 +3,17 @@ 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; }; @@ -21,15 +21,16 @@ lib.fix (self: { 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; }; diff --git a/pkgs/servers/web-apps/netbox/fix-doc-link.patch b/pkgs/servers/web-apps/netbox/fix-doc-link.patch new file mode 100644 index 0000000000000..0be5aee957f31 --- /dev/null +++ b/pkgs/servers/web-apps/netbox/fix-doc-link.patch @@ -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 diff --git a/pkgs/servers/web-apps/netbox/generic.nix b/pkgs/servers/web-apps/netbox/generic.nix index ec544b1e87724..ac705445499fd 100644 --- a/pkgs/servers/web-apps/netbox/generic.nix +++ b/pkgs/servers/web-apps/netbox/generic.nix @@ -58,6 +58,7 @@ pillow psycopg2 pyyaml + requests sentry-sdk social-auth-core social-auth-app-django diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ed5f2afd2372e..65566cbc0a921 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e481a780c3ce8..56edc78a360bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };