diff --git a/flake.nix b/flake.nix index 1abf156..3cbd238 100644 --- a/flake.nix +++ b/flake.nix @@ -55,15 +55,6 @@ }; cranePkgs = makeCranePkgs pkgs; - internalMatrix = lib.mapAttrs (_: nix: let - cranePkgs' = cranePkgs.override { inherit nix; }; - in { - inherit (cranePkgs') attic-tests cargoArtifacts; - }) { - "2.20" = pkgs.nixVersions.nix_2_20; - "2.24" = pkgs.nixVersions.nix_2_24; - "default" = pkgs.nix; - }; pkgsStable = import inputs.nixpkgs-stable { inherit system; @@ -73,8 +64,6 @@ inherit (pkgs) lib; in rec { - inherit internalMatrix; - checks = let makeIntegrationTests = pkgs: import ./integration-tests { pkgs = import inputs.nixpkgs { diff --git a/flake/nix-versions.nix b/flake/nix-versions.nix index 66f3697..b0b8df6 100644 --- a/flake/nix-versions.nix +++ b/flake/nix-versions.nix @@ -1,4 +1,4 @@ -{ lib, flake-parts-lib, ... }: +{ lib, flake-parts-lib, config, ... }: let inherit (lib) mkOption @@ -20,11 +20,17 @@ in type = types.package; }; }; + + options.internalMatrix = mkOption { + type = types.attrsOf (types.attrsOf types.package); + }; }; }; config = { - perSystem = { self', pkgs, config, ... }: let + flake.internalMatrix = lib.mapAttrs (system: ps: ps.internalMatrix) config.allSystems; + + perSystem = { self', pkgs, config, cranePkgs, ... }: let cfg = config.attic.nix-versions; in { attic.nix-versions = { @@ -47,6 +53,12 @@ in }) cfg.versions; in pkgs.writeText "nix-versions.json" (builtins.toJSON manifest); }; + + internalMatrix = lib.mapAttrs (_: nix: let + cranePkgs' = cranePkgs.override { inherit nix; }; + in { + inherit (cranePkgs') attic-tests cargoArtifacts; + }) cfg.versions; }; }; }