From c84d84231bf7f4b008cfc55c266736a323c67914 Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Wed, 28 Jan 2026 08:49:21 +1000 Subject: [PATCH] fix nt depends on pipe-operators --- flake/nix-unit.nix | 52 +++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/flake/nix-unit.nix b/flake/nix-unit.nix index a07952d..2f5767b 100644 --- a/flake/nix-unit.nix +++ b/flake/nix-unit.nix @@ -5,30 +5,44 @@ ... }: let inherit - (deps) - nixpkgs - nix-unit + (builtins) + concatStringsSep ; inherit (this.util) forAllSystems ; + + inherit + (deps) + nixpkgs + nix-unit + ; +in let + enable-experimental = concatStringsSep " " [ + "flakes" + "nix-command" + "pipe-operators" + ]; in { - checks = forAllSystems (system: { - default = - nixpkgs.legacyPackages.${system}.runCommand "tests" - { - nativeBuildInputs = [nix-unit.packages.${system}.default]; - } - '' - export HOME="$(realpath .)" - # The nix derivation must be able to find all used inputs in the nix-store because it cannot download it during buildTime. - nix-unit --eval-store "$HOME" \ - --extra-experimental-features flakes \ - --override-input nixpkgs ${nixpkgs} \ - --flake ${flake}#tests - touch $out - ''; - }); + # XXX: TODO: assert false || throw "TEST: type of flake is \"${builtins.typeOf flake}\"" + checks = forAllSystems ( + system: pkgs: { + default = + pkgs.runCommand "tests" + { + nativeBuildInputs = [nix-unit.packages.${system}.default]; + } + '' + export HOME="$(realpath .)" + # The nix derivation must be able to find all used inputs in the nix-store because it cannot download it during buildTime. + nix-unit --eval-store "$HOME" \ + --extra-experimental-features "${enable-experimental}" \ + --override-input nixpkgs ${nixpkgs} \ + --flake ${flake}\#tests + touch $out + ''; + } + ); }