From 6c91cff672e6b5276cc44c3d8cb6addef760ce7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 9 Jul 2024 13:49:42 +0200 Subject: [PATCH 1/2] better project root hint --- formatter.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formatter.nix b/formatter.nix index 1cdc3365..a709eb5f 100644 --- a/formatter.nix +++ b/formatter.nix @@ -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; From a24c183ec5e8c92aca8c5bb76bd42933c45b0442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 9 Jul 2024 14:44:35 +0200 Subject: [PATCH 2/2] lib.readFact: change order of arguments --- lib/facts.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/facts.nix b/lib/facts.nix index ccec1de5..46c595dd 100644 --- a/lib/facts.nix +++ b/lib/facts.nix @@ -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 (