From 25e81d251ead96f2be7858f175043e392c73fb6b Mon Sep 17 00:00:00 2001
From: zowoq <59103226+zowoq@users.noreply.github.com>
Date: Mon, 25 Nov 2024 09:48:27 +1000
Subject: [PATCH] modules/nixos/common: set narinfo-cache-negative-ttl for
 update

also drop booted-system check
---
 modules/nixos/common/update.bash | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/nixos/common/update.bash b/modules/nixos/common/update.bash
index 36a860e..fd823a7 100644
--- a/modules/nixos/common/update.bash
+++ b/modules/nixos/common/update.bash
@@ -2,14 +2,11 @@ arch=$(uname -m)
 hostname=$(uname -n)
 p=$(curl -L https://buildbot.nix-community.org/nix-outputs/nix-community/infra/master/"$arch"-linux.host-"$hostname")
 
-if [[ "$(readlink /run/booted-system)" == "$p" ]]; then
-  exit 0
-fi
 if [[ "$(readlink /run/current-system)" == "$p" ]]; then
   exit 0
 fi
 
-nix-store --realise "$p"
+nix-store --option narinfo-cache-negative-ttl 0 --realise "$p"
 nix-env --profile /nix/var/nix/profiles/system --set "$p"
 
 booted="$(readlink /run/booted-system/{initrd,kernel,kernel-modules} && cat /run/booted-system/kernel-params)"