mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-16 23:27:17 +02:00
refact: concatMapAttrs -> flatMapAttrs
This should be slightly easier to read. We could apply this to all concatMapAttrs calls.
This commit is contained in:
parent
ac89828b5a
commit
6a28566db6
1 changed files with 23 additions and 8 deletions
29
flake.nix
29
flake.nix
|
@ -58,6 +58,18 @@
|
||||||
"stdenv"
|
"stdenv"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
`flatMapAttrs attrs f` applies `f` to each attribute in `attrs` and
|
||||||
|
merges the results into a single attribute set.
|
||||||
|
|
||||||
|
This can be nested to form a build matrix where all the attributes
|
||||||
|
generated by the innermost `f` are returned as is.
|
||||||
|
(Provided that the names are unique.)
|
||||||
|
|
||||||
|
See https://nixos.org/manual/nixpkgs/stable/index.html#function-library-lib.attrsets.concatMapAttrs
|
||||||
|
*/
|
||||||
|
flatMapAttrs = attrs: f: lib.concatMapAttrs f attrs;
|
||||||
|
|
||||||
forAllSystems = lib.genAttrs systems;
|
forAllSystems = lib.genAttrs systems;
|
||||||
|
|
||||||
forAllCrossSystems = lib.genAttrs crossSystems;
|
forAllCrossSystems = lib.genAttrs crossSystems;
|
||||||
|
@ -319,17 +331,20 @@
|
||||||
# system, we should reenable this.
|
# system, we should reenable this.
|
||||||
#perlBindings = self.hydraJobs.perlBindings.${system};
|
#perlBindings = self.hydraJobs.perlBindings.${system};
|
||||||
}
|
}
|
||||||
// lib.concatMapAttrs (nixpkgsPrefix: nixpkgs:
|
|
||||||
lib.concatMapAttrs (pkgName: pkg:
|
|
||||||
lib.concatMapAttrs (testName: test: {
|
|
||||||
# Add "passthru" tests
|
# Add "passthru" tests
|
||||||
"${nixpkgsPrefix}${pkgName}-${testName}" = test;
|
// flatMapAttrs {
|
||||||
}) pkg.tests or {}
|
|
||||||
) nixpkgs.nix-components
|
|
||||||
) {
|
|
||||||
"" = nixpkgsFor.${system}.native;
|
"" = nixpkgsFor.${system}.native;
|
||||||
"static-" = nixpkgsFor.${system}.static;
|
"static-" = nixpkgsFor.${system}.static;
|
||||||
}
|
}
|
||||||
|
(nixpkgsPrefix: nixpkgs:
|
||||||
|
flatMapAttrs nixpkgs.nix-components
|
||||||
|
(pkgName: pkg:
|
||||||
|
flatMapAttrs pkg.tests or {}
|
||||||
|
(testName: test: {
|
||||||
|
"${nixpkgsPrefix}${pkgName}-${testName}" = test;
|
||||||
|
})
|
||||||
|
)
|
||||||
|
)
|
||||||
// devFlake.checks.${system} or {}
|
// devFlake.checks.${system} or {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue