From def1e485d5481f5e7df5465a22d8cf6c3d433ede Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:42:47 +0100 Subject: [PATCH] stylix: make nix-flake-check package execution location-independent Make the execution of the nix-flake-check package independent of the current working directory, making the following command work as expected: nix run github:danth/stylix#nix-flake-check This is especially convenient for testing PRs locally without checking them out. --- flake.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 0bc7ca46..2898089d 100644 --- a/flake.nix +++ b/flake.nix @@ -155,7 +155,7 @@ ]; text = '' - nix flake show --json --no-update-lock-file | + nix flake show --json --no-update-lock-file ${self} | jq --raw-output ' ((.checks."${system}" // {}) | keys) as $checks | ((.packages."${system}" // {}) | keys) as $packages | @@ -168,7 +168,10 @@ --color-failed \ --halt now,fail=1 \ --tagstring '{}' \ - 'nix build --no-update-lock-file --print-build-logs .#{}' + ' + nix build --no-update-lock-file --print-build-logs \ + ${self}#{} + ' ''; };