llakala / nixos

My NixOS config
3 stars 1 forks source link

Give our custom import function the ability to deal with sets #35

Closed llakala closed 1 week ago

llakala commented 4 weeks ago

Currently, the importAll function can handle both individual files, or folders. The last thing we really need from it is the ability to handle sets. While ideally it would also be able to deal with something like inputs.nixos-hardware.nixosModules.framework-13-7040-amd, that's not really necessary for our current purposes.

I know there's some great references for this out there, like umport somewhere on discourse, but I'll leave finding these as an exercise for the viewer.

llakala commented 2 weeks ago

As I've been refactoring before going through with this, here's an awesome reference:

https://github.com/sttagent/evilwoods-nixos-config/blob/b9d1b949c284fb25f1ff9221f88c909bb7232a3f/lib/default.nix#L17

And here's some more references:

https://github.com/chuahou/conf.nix/blob/af6de353439d9e6814a21a2a9caede5368497bfb/home/default.nix#L9 https://github.com/chuahou/conf.nix/blob/af6de353439d9e6814a21a2a9caede5368497bfb/home/default.nix

llakala commented 2 weeks ago

Cleaned up the code.

Turns out, modules is really just a wrapper around imports. If we can figure out how imports does it, or ideally, have imports handle it directly, that'd be perfect. Maybe we can just leave it unchanged. Yeah, i think that would do it. Good luck, tomorrow me.

llakala commented 1 week ago

Done with a lot of code cleanup in babfbd571f91d095cac970f66c1648750cf039ed. I'm actually quite happy with the state of this code: I'd like to extract it to a separate project now.