From e830691a697a3a5d0e4461ceb073ac36abdfe3d6 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 29 Apr 2022 16:50:44 -0700 Subject: [PATCH] Switch from 'nix eval' to 'nix-instantiate --eval' Nix 2.4 changed the interface to 'nix eval' so that --arg doesn't work anymore. This is a workaround for https://github.com/NixOS/nix/issues/2678 --- modules/auto-upgrade.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/auto-upgrade.nix b/modules/auto-upgrade.nix index 54a3083..4a5aa83 100644 --- a/modules/auto-upgrade.nix +++ b/modules/auto-upgrade.nix @@ -144,12 +144,12 @@ let + concatMapStringsSep "\n" (f: "verify_ownership ${escapeShellArg f}") cfg.upgradeConfig)} - config=$(${pkgs.nix}/bin/nix eval --json -f ${../upgrade-config.nix} \ + config=$(${pkgs.nix}/bin/nix-instantiate --eval --strict --json -A config \ --arg upgradeConfig ${ escapeShellArg ("[" + lib.concatMapStringsSep " " lib.strings.escapeNixString cfg.upgradeConfig + "]") - } config) + } ${../upgrade-config.nix}) config_query() { ${pkgs.jq}/bin/jq -r "$@" <<< "$config" -- 2.44.1