From c0691b8d8d4dff45a435a54a8cf13e76ab2a955c Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Fri, 13 Jan 2023 00:02:41 +0000 Subject: [PATCH] doc: added comments explaining teh function --- flake.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a25cd8c..ad8aa53 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,16 @@ # map applies this function to every item in an array create_nixosConfigurations = map ( # converts it into {name_of_machiene = {system = '..'; modules = '..'}} - config: {${config.name} = nixpkgs.lib.nixosSystem (nixpkgs.lib.attrsets.filterAttrs (n: v: n != "name") config); } + config: { + # need to extract teh name of the machiene + ${config.name} = ( + # nixpkgs.lib.nixosSystem is a fucntion that is used to turn a attribute set into the config for a machiene + nixpkgs.lib.nixosSystem ( + # dont want to pass the field named 'name' into teh set + nixpkgs.lib.attrsets.filterAttrs (n: v: n != "name") config + ) + ); + } ); # this merges together an array of atributes