mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-19 08:31:01 +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)
(cherry picked from commit fe58368de6
)
This commit is contained in:
parent
2d04bf7ee4
commit
1e54c20bd2
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue