mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00: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
@ -298,7 +298,7 @@ in {
|
||||
# This mostly correspond to upstream NetBox's 'upgrade.sh' script.
|
||||
versionFile="${cfg.dataDir}/version"
|
||||
|
||||
if [[ -e "$versionFile" && "$(cat "$versionFile")" == "${cfg.package.version}" ]]; then
|
||||
if [[ -h "$versionFile" && "$(readlink -- "$versionFile")" == "${cfg.package}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -314,7 +314,7 @@ in {
|
||||
(lib.versionOlder cfg.package.version "3.7.0")
|
||||
"${pkg}/bin/netbox clearcache"}
|
||||
|
||||
echo "${cfg.package.version}" > "$versionFile"
|
||||
ln -sfn "${cfg.package}" "$versionFile"
|
||||
'';
|
||||
|
||||
serviceConfig = defaultServiceConfig // {
|
||||
|
Loading…
Reference in New Issue
Block a user