mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixos/netbox: switch to symlink to check for upgrades
This makes it so that the upgrade script also runs when the configuration changed, or when plugins were added. This is also a hack to force everyone to run the upgrade script again, since static files might have been copied incorrectly (see parent commit)
This commit is contained in:
parent
ff6d89ac69
commit
fe58368de6
1 changed files with 2 additions and 2 deletions
|
@ -298,7 +298,7 @@ in {
|
||||||
# This mostly correspond to upstream NetBox's 'upgrade.sh' script.
|
# This mostly correspond to upstream NetBox's 'upgrade.sh' script.
|
||||||
versionFile="${cfg.dataDir}/version"
|
versionFile="${cfg.dataDir}/version"
|
||||||
|
|
||||||
if [[ -e "$versionFile" && "$(cat "$versionFile")" == "${cfg.package.version}" ]]; then
|
if [[ -h "$versionFile" && "$(readlink -- "$versionFile")" == "${cfg.package}" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ in {
|
||||||
(lib.versionOlder cfg.package.version "3.7.0")
|
(lib.versionOlder cfg.package.version "3.7.0")
|
||||||
"${pkg}/bin/netbox clearcache"}
|
"${pkg}/bin/netbox clearcache"}
|
||||||
|
|
||||||
echo "${cfg.package.version}" > "$versionFile"
|
ln -sfn "${cfg.package}" "$versionFile"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig = defaultServiceConfig // {
|
serviceConfig = defaultServiceConfig // {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue