From 692e94a1cf24eeab2129935c63a5094611389b1b Mon Sep 17 00:00:00 2001 From: whispers Date: Fri, 10 Apr 2026 18:00:56 -0400 Subject: [PATCH] nixos-rebuild-ng: don't resolve /run/current-system symlink for --diff Before running `nix store diff-closures`, `nixos-rebuild-ng` tried to read the symlink on the local system. While this provides for better logging, when paired with `--target-host`, it causes deploy failures as it tries to diff the config of the local system against the target. Even if the store path of the local system happens to be on the target, the diff is incorrect, as its comparing two different systems against each other instead of the old and new closures on the target system. Accordingly, we simply avoid resolving the symlink on the host system. If a future solution would like to fix this, it should make sure to do the reading for debug printing on the *target* sytem, not the local one. --- pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/services.py b/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/services.py index 8a170a138326..4de74aa9c4d4 100644 --- a/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/services.py +++ b/pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/services.py @@ -323,7 +323,7 @@ def build_and_activate_system( if args.diff: if current_config.exists(): nix.diff_closures( - current_config=current_config.readlink(), + current_config=current_config, new_config=path_to_config, target_host=target_host, )