doc: added comments explaining teh function

This commit is contained in:
silver 2023-01-13 00:02:41 +00:00
parent 8ef0e1e3d6
commit c0691b8d8d

View file

@ -32,7 +32,16 @@
# map applies this function to every item in an array # map applies this function to every item in an array
create_nixosConfigurations = map ( create_nixosConfigurations = map (
# converts it into {name_of_machiene = {system = '..'; modules = '..'}} # 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 # this merges together an array of atributes