From c962694a080dd59d2ff92fc002dbebeb2598ece0 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 11 Sep 2026 09:00:20 +0200 Subject: [PATCH] netbox: 4.6.8 -> 4.7.0 --- .../manual/release-notes/rl-2611.section.md | 8 +++-- nixos/modules/services/web-apps/netbox.nix | 33 +++++++------------ pkgs/by-name/ne/netbox/package.nix | 13 ++------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 21 insertions(+), 36 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2611.section.md b/nixos/doc/manual/release-notes/rl-2611.section.md index 7bfb43ae3aa1..87c4514e0f7b 100644 --- a/nixos/doc/manual/release-notes/rl-2611.section.md +++ b/nixos/doc/manual/release-notes/rl-2611.section.md @@ -300,9 +300,11 @@ - `chatgpt` has been retargeted to OpenAI's new ChatGPT desktop app, while the previous app has been renamed to `chatgpt-classic`. -- NetBox was updated to `>= 4.6.8`. Have a look at the breaking changes - of the [4.6 release](https://github.com/netbox-community/netbox/releases/tag/v4.6.0), - make the required changes to your database, if needed, then upgrade by setting `services.netbox.package = pkgs.netbox_4_6;` in your configuration. +- NetBox was updated to `>= 4.7.0`. Have a look at the breaking changes + of the [4.6 release](https://github.com/netbox-community/netbox/releases/tag/v4.6.0) + and the [4.7 release](https://github.com/netbox-community/netbox/releases/tag/v4.7.0), + make the required changes to your configuration and database, if needed, + before you upgrade to NixOS 26.11. - The COSMIC desktop module now enables by default `system76-power` and `system76-scheduler` following upstream recommended packages. The previous power managment service can be enabled back by setting `services.power-profiles-daemon.enable = true`. diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index 3bf417d9129c..22ff64c36f5a 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -434,10 +434,10 @@ in package = lib.mkOption { type = types.package; default = - if lib.versionAtLeast config.system.stateVersion "26.11" then pkgs.netbox_4_6 else pkgs.netbox_4_5; + if lib.versionAtLeast config.system.stateVersion "26.11" then pkgs.netbox_4_7 else pkgs.netbox_4_5; defaultText = lib.literalExpression '' if lib.versionAtLeast config.system.stateVersion "26.11" then - pkgs.netbox_4_6 + pkgs.netbox_4_7 else pkgs.netbox_4_5; ''; @@ -563,6 +563,15 @@ in config = lib.mkIf cfg.enable ( lib.mkMerge [ { + assertions = [ + { + assertion = + cfg.postgresql.createLocally + -> lib.versionAtLeast config.services.postgresql.finalPackage.version "15"; + message = "NetBox requires PostgreSQL >= 15. Please read the NixOS manual to upgrade your PostgreSQL version."; + } + ]; + services.netbox.plugins = lib.mkIf enableLDAP (ps: [ ps.django-auth-ldap ]); services.redis.servers.netbox.enable = cfg.redis.createLocally; @@ -733,26 +742,6 @@ in PrivateTmp = true; }; }; - - netbox-housekeeping = defaultUnitConfig // { - description = "NetBox housekeeping job"; - - wantedBy = [ "multi-user.target" ]; - - after = [ - "network-online.target" - "netbox.service" - ]; - wants = [ "network-online.target" ]; - - serviceConfig = defaultServiceConfig // { - Type = "oneshot"; - ExecStart = toString [ - (lib.getExe finalPackage) - "housekeeping" - ]; - }; - }; }; systemd.timers.netbox-housekeeping = { diff --git a/pkgs/by-name/ne/netbox/package.nix b/pkgs/by-name/ne/netbox/package.nix index 249f5c8a072d..24539cd138a0 100644 --- a/pkgs/by-name/ne/netbox/package.nix +++ b/pkgs/by-name/ne/netbox/package.nix @@ -2,7 +2,6 @@ lib, fetchFromGitHub, python3, - fetchpatch2, plugins ? _ps: [ ], nixosTests, nix-update-script, @@ -21,24 +20,18 @@ py.pkgs.buildPythonApplication (finalAttrs: { __structuredAttrs = true; pname = "netbox"; - version = "4.6.8"; + version = "4.7.0"; pyproject = false; src = fetchFromGitHub { owner = "netbox-community"; repo = "netbox"; tag = "v${finalAttrs.version}"; - hash = "sha256-fhEcQBYL5R9Tv9CpAf3Ce1oIzsXCjtH5j+dP9sD6kdg="; + hash = "sha256-u6gS/k2WJuziuENIF4DbepvOKFNN6kxAIyX22J9xP7Q="; }; patches = [ ./custom-static-root.patch - # TODO: remove before upgrading to NetBox v4.7 - (fetchpatch2 { - name = "upgrade-django-tables2-v3.0.patch"; - url = "https://github.com/netbox-community/netbox/commit/d57346d9f0eef8126eafcd5033ea43864faeaf0d.patch"; - hash = "sha256-6/wdd8wDVT4eqDKMNx8tmoPTDvw8OE7atf9nzg3LZzk="; - }) ]; dependencies = @@ -53,7 +46,7 @@ py.pkgs.buildPythonApplication (finalAttrs: { django-graphiql-debug-toolbar django-htmx django-mptt - django-pglocks + django-pgware django-prometheus django-redis django-rq diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 1150da98a4da..c28926a26fc7 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1804,6 +1804,7 @@ mapAliases { netbox_4_3 = throw "netbox 4.3 series has been removed as it was EOL"; # Added 2026-08-24 netbox_4_4 = throw "netbox 4.4 series has been removed as it was EOL"; # Added 2026-08-24 netbox_4_5 = throw "netbox 4.5 series has been removed as it was EOL"; # Added 2026-08-24 + netbox_4_6 = throw "netbox 4.6 series has been removed as it was EOL"; # Added 2026-08-24 netbsdCross = throw "'netbsdCross' has been renamed to/replaced by 'netbsd'"; # Converted to throw 2025-10-27 netsurf.browser = throw "'netsurf.browser' has been renamed to/replaced by 'netsurf-browser'"; # Converted to throw 2025-10-27 netsurf.buildsystem = throw "'netsurf.buildsystem' has been renamed to/replaced by 'netsurf-buildsystem'"; # Converted to throw 2025-10-27 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4cce505519d7..d6c2b51c2481 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2495,7 +2495,7 @@ with pkgs; ioskeley-mono = recurseIntoAttrs (callPackage ../data/fonts/ioskeley-mono { }); - netbox_4_6 = netbox; + netbox_4_7 = netbox; netboxPlugins = recurseIntoAttrs netbox.plugins;