mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 03:39:59 +00:00
netbox: 4.6.8 -> 4.7.1 (#563496)
This commit is contained in:
@@ -302,9 +302,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`.
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -126,6 +126,8 @@ in
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
};
|
||||
|
||||
interactive.sshBackdoor.enable = true;
|
||||
|
||||
testScript =
|
||||
let
|
||||
changePassword = pkgs.writeText "change-password.py" ''
|
||||
|
||||
@@ -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.1";
|
||||
pyproject = false;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "netbox-community";
|
||||
repo = "netbox";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-fhEcQBYL5R9Tv9CpAf3Ce1oIzsXCjtH5j+dP9sD6kdg=";
|
||||
hash = "sha256-6IJrDD+1yBv15cbJwZOLkwiAlGZH2zRC+a/CG79C10Y=";
|
||||
};
|
||||
|
||||
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 =
|
||||
@@ -50,10 +43,9 @@ py.pkgs.buildPythonApplication (finalAttrs: {
|
||||
django-cors-headers
|
||||
django-debug-toolbar
|
||||
django-filter
|
||||
django-graphiql-debug-toolbar
|
||||
django-htmx
|
||||
django-mptt
|
||||
django-pglocks
|
||||
django-pgware
|
||||
django-prometheus
|
||||
django-redis
|
||||
django-rq
|
||||
|
||||
70
pkgs/development/python-modules/django-pgware/default.nix
Normal file
70
pkgs/development/python-modules/django-pgware/default.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
hatchling,
|
||||
django,
|
||||
postgresql,
|
||||
postgresqlTestHook,
|
||||
pytestCheckHook,
|
||||
pytest-django,
|
||||
pytest-asyncio,
|
||||
psycopg2,
|
||||
psycopg,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "django-pgware";
|
||||
version = "1.0.0";
|
||||
pyproject = true;
|
||||
__structuredAttrs = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Xof";
|
||||
repo = "django-pgware";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-OvdgqM0W6KPkszNrpeRjmg/powepPyKhfP1OsWaDMSE=";
|
||||
};
|
||||
|
||||
build-system = [ hatchling ];
|
||||
dependencies = [ django ];
|
||||
nativeCheckInputs = [
|
||||
postgresql
|
||||
postgresqlTestHook
|
||||
pytestCheckHook
|
||||
pytest-django
|
||||
pytest-asyncio
|
||||
psycopg2
|
||||
];
|
||||
|
||||
optional-dependencies = {
|
||||
psycopg2 = [
|
||||
psycopg2
|
||||
];
|
||||
psycopg3 = [
|
||||
psycopg
|
||||
];
|
||||
};
|
||||
|
||||
pythonImportsCheck = [ "django_pg_utils" ];
|
||||
|
||||
env.PGDATABASE = "django_pg_utils";
|
||||
|
||||
preCheck = ''
|
||||
# Else we get:
|
||||
# django.core.exceptions.ImproperlyConfigured: Requested setting <SOMETHING>, but settings are not configured
|
||||
export DJANGO_SETTINGS_MODULE="tests.django_settings"
|
||||
export POSTGRES_HOST="$PGHOST"
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
description = "Useful PostgreSQL-specific Django utiites";
|
||||
homepage = "https://github.com/Xof/django-pgware";
|
||||
changelog = "https://github.com/Xof/django-pgware/blob/${finalAttrs.src.rev}/CHANGELOG.md";
|
||||
license = [ lib.licenses.postgresql ];
|
||||
maintainers = with lib.maintainers; [ minijackson ];
|
||||
};
|
||||
})
|
||||
@@ -1814,6 +1814,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -4807,6 +4807,8 @@ self: super: with self; {
|
||||
|
||||
django-pgtrigger = callPackage ../development/python-modules/django-pgtrigger { };
|
||||
|
||||
django-pgware = callPackage ../development/python-modules/django-pgware { };
|
||||
|
||||
django-phonenumber-field = callPackage ../development/python-modules/django-phonenumber-field { };
|
||||
|
||||
django-picklefield = callPackage ../development/python-modules/django-picklefield { };
|
||||
|
||||
Reference in New Issue
Block a user