forked from Fediversity/Fediversity
listToAttrs
o map
o attrsToList
→ mapAttrs'
(#489)
Reviewed-on: Fediversity/Fediversity#489 Reviewed-by: kiara Grouwstra <kiara@procolix.eu> Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com> Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
This commit is contained in:
parent
588bb77a94
commit
1f99a4c6c3
1 changed files with 13 additions and 25 deletions
|
@ -14,9 +14,7 @@ let
|
|||
mkOption
|
||||
evalModules
|
||||
filterAttrs
|
||||
attrsToList
|
||||
map
|
||||
listToAttrs
|
||||
mapAttrs'
|
||||
deepSeq
|
||||
;
|
||||
inherit (lib.attrsets) genAttrs;
|
||||
|
@ -200,27 +198,17 @@ in
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
checks =
|
||||
listToAttrs (
|
||||
map (
|
||||
{ name, value }:
|
||||
{
|
||||
mapAttrs' (name: nixosConfiguration: {
|
||||
name = "nixosConfigurations-${name}";
|
||||
value = value.config.system.build.toplevel;
|
||||
}
|
||||
) (attrsToList nixosConfigurations)
|
||||
)
|
||||
// listToAttrs (
|
||||
map (
|
||||
{ name, value }:
|
||||
{
|
||||
value = nixosConfiguration.config.system.build.toplevel;
|
||||
}) nixosConfigurations
|
||||
// mapAttrs' (name: vmOptions: {
|
||||
name = "vmOptions-${name}";
|
||||
## Check that VM options builds/evaluates correctly. `deepSeq e1
|
||||
## e2` evaluates `e1` strictly in depth before returning `e2`. We
|
||||
## use this trick because checks need to be derivations, which VM
|
||||
## options are not.
|
||||
value = deepSeq value pkgs.hello;
|
||||
}
|
||||
) (attrsToList vmOptions)
|
||||
);
|
||||
value = deepSeq vmOptions pkgs.hello;
|
||||
}) vmOptions;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue