lib.readFact: change order of arguments #1721

Merged
clan-bot merged 2 commits from Mic92-main into main 2024-07-09 12:59:48 +00:00
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
perSystem =
{ self', pkgs, ... }:
{
treefmt.projectRootFile = "flake.nix";
treefmt.projectRootFile = ".git/config";
treefmt.programs.shellcheck.enable = true;
treefmt.programs.mypy.enable = true;

View File

@ -4,10 +4,10 @@ let
allMachineNames = lib.mapAttrsToList (name: _: name) (builtins.readDir clanDir);
getFactPath = fact: machine: "${clanDir}/${machine}/facts/${fact}";
getFactPath = machine: fact: "${clanDir}/${machine}/facts/${fact}";
readFact =
fact: machine:
machine: fact:
let
path = getFactPath fact machine;
in
@ -24,7 +24,7 @@ let
fact:
let
machines = allMachineNames;
facts = lib.genAttrs machines (readFact fact);
facts = lib.genAttrs machines (machine: readFact machine fact);
filteredFacts = lib.filterAttrs (_machine: fact: fact != null) facts;
in
filteredFacts;
@ -51,7 +51,7 @@ let
let
# machine -> fact -> factvalue
machinesFactsAttrs = lib.genAttrs allMachineNames (
machine: lib.genAttrs facts (fact: readFact fact machine)
machine: lib.genAttrs facts (fact: readFact machine fact)
);
# remove all machines which don't have all facts set
filteredMachineFactAttrs = lib.filterAttrs (