From 43a21e8d3485d4e8ebde22c9d3db760a59610b22 Mon Sep 17 00:00:00 2001 From: Charlotte Delenk Date: Fri, 8 Nov 2024 11:28:46 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20bootloop=20if=20booted=20into?= =?UTF-8?q?=20plymouth=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/nix/autoupdater.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/nix/autoupdater.nix b/modules/nix/autoupdater.nix index 30d684a1..42cd9db9 100644 --- a/modules/nix/autoupdater.nix +++ b/modules/nix/autoupdater.nix @@ -51,10 +51,11 @@ in serviceConfig.Type = "oneshot"; script = let - switchToConfiguration = + output = if cfg.specialisation == null - then "$output/bin/switch-to-configuration switch" - else "$output/specialisation/${cfg.specialisation}/bin/switch-to-configuration"; + then "$output" + else "$output/specialisation/${cfg.specialisation}"; + switchToConfiguration = "${output}/bin/switch-to-configuration"; in '' #!${pkgs.bash}/bin/bash set -euxo pipefail @@ -68,7 +69,7 @@ in then '' ${switchToConfiguration} boot booted="$(${pkgs.coreutils}/bin/readlink /run/booted-system/{initrd,kernel,kernel-modules})" - built="$(${pkgs.coreutils}/bin/readlink $output/{initrd,kernel,kernel-modules})" + built="$(${pkgs.coreutils}/bin/readlink ${output}/{initrd,kernel,kernel-modules})" if [ "$booted" = "$built" ]; then ${switchToConfiguration} switch else