19 Aug 2024 |
| @stooj:matrix.org joined the room. | 13:17:52 |
Arian | We really ought to have a nixbot in here | 17:30:45 |
Tranquil Ity | How's the IO purity of Nix ? | 17:41:18 |
Tranquil Ity | Like, as a language | 17:41:29 |
Tranquil Ity | * Like, as a language, from within the language | 17:41:34 |
Tranquil Ity | Ik that there's IO impls but unsure how they work | 17:41:48 |
infinisil | Tranquil Ity: Not really what you're asking, but https://github.com/infinisil/nix-rts :P | 17:56:00 |
Tranquil Ity | Yaa I think you linked that before, the question is how it works ig | 18:02:33 |
20 Aug 2024 |
| benwebb changed their display name from benjaminedwardwebb to benwebb. | 12:44:18 |
| lgmrszd changed their profile picture. | 18:03:54 |
21 Aug 2024 |
| Sigmanificient joined the room. | 00:46:32 |
| @mauerlaeufer:matrix.org left the room. | 12:23:12 |
| Luna changed their display name from Luna Simons to Luna. | 16:22:35 |
| @shymega:one.ems.host joined the room. | 16:36:42 |
22 Aug 2024 |
| Artur Manuel joined the room. | 12:32:13 |
Artur Manuel | moving an issue i have been having to this channel since its more on topic here than #Nix / NixOS But i | 13:06:37 |
Artur Manuel | moving an issue i have been having to this channel since its more on topic here than #Nix / NixOS But I recently had an issue involving a library function with mkMerge that was a consequence of not using flake-parts. | 13:08:26 |
Artur Manuel | My issue is that I now dont know what function I can apply to hold the place of mkMerge, and I don't think Noogle is helping much | 13:14:14 |
Artur Manuel | my current attempted solutions (map, listToAttrs, maybe more) have all not worked | 14:03:10 |
Artur Manuel | almost considering rewriting li | 14:03:26 |
Artur Manuel | Redacted or Malformed Event | 14:03:32 |
Artur Manuel | * almost considering rewriting my mkHost function | 14:04:38 |
| @matrix:03j.de joined the room. | 14:21:30 |
| Artur Manuel changed their profile picture. | 14:53:03 |
| @benwis:matrix.org left the room. | 16:48:21 |
| nyanbinary 🏳️⚧️ left the room. | 17:19:40 |
Matt Sturgeon | In reply to @asmundesen:matrix.org moving an issue i have been having to this channel since its more on topic here than #Nix / NixOS But I recently had an issue involving a library function with mkMerge that was a consequence of not using flake-parts. What did your implementation using mkMerge look like? What is the purpose of the function, i.e. what are you trying to achieve?
I'm sure you've worked this out by now, but mkMerge is not a general use nix function; it is only useful when working with the nixos module system.
| 21:51:45 |
@adis:blad.is | I really wish stuff like mkMerge wasn't in top-level lib. It's confusing as heck. | 23:28:39 |
23 Aug 2024 |
| fpf3 joined the room. | 00:30:24 |
Matt Sturgeon | Ok, found it: https://matrix.to/#/!RRerllqmbATpmbJgCn:nixos.org/$0WVAvACN5DN8NLuPU7hmS2ZaGKNcCYMxB1jkhb99Lqk?via=nixos.org&via=matrix.org&via=tchncs.de
Artur Manuel
Looks like you are trying to convert a list of config-spec-attrsets into an attrset of nixos configurations. Currently you're passing a list of attrs to genAttrs , which won't work because genAttrs expects a list of string; the strings are also used as the attr names.
I'd recommend having an attrset of config-sepcs instead of a list, and then using mapAttrs to convert them to actual nixos-configurations.
e.g.
let
mkHosts = builtins.mapAttrs (name: configSpec: inputs.nixpkgs.lib.nixosSystem {
# TODO
});
in
nixosConfigurations = mkHosts {
"freguson" = {
hostname = "freguson";
username = "amadal";
system = "x86_64-linux";
# etc
};
};
However, if you don't want to do that, you'll need to use listToAttrs , after map ing the list such that the elements have the form { name = "attr_name"; value = "attr_value"; } (as extected by listToAttrs ).
e.g.
builtins.listToAttrs (
builtins.map
(configSpec: {
name = configSpec.hostname;
value = inputs.nixpkgs.lib.nixosSystem {
# TODO
};
})
configSpecList
)
| 01:14:01 |