diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 978152a0ccba..fa9ee5a9bdf4 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -66,6 +66,8 @@ - The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x. +- `netbox-manage` script created by the `netbox` module no longer uses `sudo -u netbox` internally. It can be run as root and will change it's user to `netbox` using `runuser` + - `services.dwm-status.extraConfig` was replaced by [RFC0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md)-compliant [](#opt-services.dwm-status.settings), which is used to generate the config file. `services.dwm-status.order` is now moved to [](#opt-services.dwm-status.settings.order), as it's a part of the config file. - `gitversion` was updated to 6.3.0, which includes a number of breaking changes, old configurations may need updating or they will cause the tool to fail to run. diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index eefa274cc5fd..b008e46a7529 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -39,7 +39,14 @@ let (writeScriptBin "netbox-manage" '' #!${stdenv.shell} export PYTHONPATH=${pkg.pythonPath} - sudo -u netbox ${pkg}/bin/netbox "$@" + case "$(whoami)" in + "root") + ${util-linux}/bin/runuser -u netbox -- ${pkg}/bin/netbox "$@";; + "netbox") + ${pkg}/bin/netbox "$@";; + *) + echo "This must be run by either by root 'netbox' user" + esac ''); in