aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-09-03 19:18:37 +0530
committersinanmohd <sinan@sinanmohd.com>2024-09-03 19:18:45 +0530
commit50dcf4c300e49a23a72350ff083f2908e5abe888 (patch)
tree8c7038ebcaed498145690feda9221ca8e3e41be1
parent0a0d4baf28ee0436536c3a9a4da86a88440f49c2 (diff)
flake/checks: use nix from inputs
-rw-r--r--flake.nix7
-rw-r--r--nixos/tests/all-tests.nix9
-rw-r--r--nixos/tests/dsl.nix3
3 files changed, 14 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix
index 409947c..079ae8b 100644
--- a/flake.nix
+++ b/flake.nix
@@ -90,9 +90,12 @@
}
);
legacyPackages = forAllSystems (
- { pkgs, ... }:
+ { pkgs, system, ... }:
+ let
+ nixPkg = nix.packages.${system}.nix;
+ in
{
- nixosTests = pkgs.callPackage ./nixos/tests/all-tests.nix { };
+ nixosTests = pkgs.callPackage ./nixos/tests/all-tests.nix { nix = nixPkg; };
}
);
checks = forAllSystems (
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 5b9710d..3c663c4 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -1,7 +1,12 @@
-{ lib, testers }:
+{
+ lib,
+ testers,
+ nix,
+ callPackage,
+}:
let
- dsl = ./dsl.nix;
+ dsl = callPackage ./dsl.nix { inherit nix; };
diamond.dag = {
nodes.a = { };
nodes.b.inputs.a = { }; # b->a
diff --git a/nixos/tests/dsl.nix b/nixos/tests/dsl.nix
index 1fc1fbc..0013424 100644
--- a/nixos/tests/dsl.nix
+++ b/nixos/tests/dsl.nix
@@ -1,3 +1,4 @@
+{ nix }:
{ lib, config, ... }:
let
@@ -92,7 +93,7 @@ in
config.nodes.builder =
{ pkgs, ... }:
let
- evanix = pkgs.callPackage ../../package.nix { };
+ evanix = pkgs.callPackage ../../package.nix { inherit nix; };
scope = pkgs.lib.makeScope pkgs.newScope scope-fun;
configJson = (pkgs.formats.json { }).generate "nix-dag.json" config.dag;