From 9fbc2ee11f47810a58ce2c96ae51c2969f974fa1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 01:20:02 +0000 Subject: krops writeDeploy: pass --no-flake if /etc/nixos/flake.nix exists nixos-rebuild deploys /etc/nixos/flake.nix instead of NIX_PATH if that file exists, so deploying anything but a flake fails on such targets. Without writeDeploy's flake parameter, nixos-rebuild gets --no-flake if /etc/nixos/flake.nix exists on the build target. nixos-rebuild versions predating flakes neither know --no-flake nor look for that file, so they don't get it. The deploy VM test covers targets with and without that file. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index eda8dcd..8f71b59 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,9 @@ draws inputs from other sources, its generated flake gets deployed, see [Flake inputs from sources](#flake-inputs-from-sources). This makes `nixos-rebuild` use `--flake`, and requires Nix with flake support (Nix 2.4 or later) on the build target. Without the name of the NixOS configuration, -`nixos-rebuild` uses the host name of the build target. +`nixos-rebuild` uses the host name of the build target. Without `flake`, +`nixos-rebuild` gets `--no-flake` if `/etc/nixos/flake.nix` exists on the +build target, so it deploys `NIX_PATH` instead of that flake. ### `force` (optional, defaults to false) -- cgit v1.3.1