diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index 605948810e30..6f5e1536d616 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -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 // {