1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

Migrate internalMatrix to flake-parts

This commit is contained in:
Zhaofeng Li 2024-08-30 12:32:10 -04:00
parent 0d9c1c826f
commit 6b1d4520f3
2 changed files with 14 additions and 13 deletions

View file

@ -55,15 +55,6 @@
}; };
cranePkgs = makeCranePkgs pkgs; 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 { pkgsStable = import inputs.nixpkgs-stable {
inherit system; inherit system;
@ -73,8 +64,6 @@
inherit (pkgs) lib; inherit (pkgs) lib;
in rec { in rec {
inherit internalMatrix;
checks = let checks = let
makeIntegrationTests = pkgs: import ./integration-tests { makeIntegrationTests = pkgs: import ./integration-tests {
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {

View file

@ -1,4 +1,4 @@
{ lib, flake-parts-lib, ... }: { lib, flake-parts-lib, config, ... }:
let let
inherit (lib) inherit (lib)
mkOption mkOption
@ -20,11 +20,17 @@ in
type = types.package; type = types.package;
}; };
}; };
options.internalMatrix = mkOption {
type = types.attrsOf (types.attrsOf types.package);
};
}; };
}; };
config = { 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; cfg = config.attic.nix-versions;
in { in {
attic.nix-versions = { attic.nix-versions = {
@ -47,6 +53,12 @@ in
}) cfg.versions; }) cfg.versions;
in pkgs.writeText "nix-versions.json" (builtins.toJSON manifest); 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;
}; };
}; };
} }