| 12 Jun 2025 |
accelbread | * extend takes mkFlake and returns a mkFlake function that automatically includes some modules | 01:49:32 |
accelbread | extraModules is part of implementation of extend | 01:50:46 |
accelbread | So not really something consumers of flakelight really need to touch | 01:51:46 |
accelbread | I should probably add to the comment where those are defined | 01:52:23 |
Zhenxing He | That's a lot of information, thanks a lot, it looks very cool, I actually have tried writing github:hezhenxing/flakelight-haskell, but I do not fully understand it when I wrote it. Just copy the others. | 01:57:15 |
accelbread | oh cool! Yeah, copying from others should be fine for that. If you get the haskell project building
=working, feel free to add it to the flakelight readme as an available module | 01:58:59 |
accelbread | * oh cool! Yeah, copying from others should be fine for that. If you get the haskell project building working, feel free to add it to the flakelight readme as an available module | 01:59:07 |
Zhenxing He | OK, I'd be very glad to be able to do some contribution | 02:01:51 |
Zhenxing He | I am also using flakelight for defining nixos configurations, I created a flake with some pre-configured nixosModules or homeModules for hyprland and xmonad, etc. These modules may referencing other modules by using inputs.self.nixosModules or inputs.self.homeModules, this works fine when defining new hosts within the flake. But when I want to use this flake as inputs in another flake, there will be problems with the inputs.self references. and also inputs.home-manager and other inputs used in the previous flake will also be missing. | 02:04:03 |
accelbread | yeah, for that you'd need to grab the other module from outside the module definition.
Are these in your nix.nixosModules directory? | 02:07:57 |
accelbread | * yeah, for that you'd need to grab the other modules from outside the module definition.
Are these in your nix.nixosModules directory? | 02:08:07 |
accelbread | you could also use relative paths for the modules | 02:08:19 |
Zhenxing He |
Yes, they are in the nix/nixosModules directory of the first flake, but I want to use then in the second flake | 02:12:10 |
accelbread | ahh, then instead of imports = [ inputs.self.nixosModules.other-module ], imports = [ ./other-module.nix ] probably works. | 02:13:44 |
accelbread | * ahh, then instead of imports = [ inputs.self.nixosModules.other-module ], imports = [ ./other-module.nix ] should work. | 02:14:38 |
Zhenxing He | Just tried, relative path seems to work, thanks!
How to solve the reference problem with extra inputs used in the first flake? | 02:17:24 |
Zhenxing He | for example, I added home-manager inputs in the first flake and used in some of the modules, but they will cause error when used in the second flake, which only added my first flake as inputs. | 02:18:27 |
Zhenxing He | Hmm, found a solution, use
inherit (myfirstflake) inputs;
instead of
inherit inputs;
seems solve the problem, but I don't know if this is the right solution. | 02:21:29 |
accelbread | for that you want the first flake to export a flakelightModule. that modules can add its inputs as default values for inputs | 02:26:45 |
accelbread | https://github.com/accelbread/flakelight-rust/blob/2e3d11f991c235eb7d499da301245bff1c323610/flake.nix#L18 | 02:27:45 |
accelbread | like this | 02:27:53 |
accelbread | this lets the consumer flake's input be used if set, and fall back to the imported flake's input | 02:29:04 |
Zhenxing He | That's cool! thank you! | 02:30:02 |
Zhenxing He | It seems when add imports = [flakelight.flakelightModules.flakelightModule], the auto imports will stop working, no nixos/home modules be automatically loaded, how can I turn auto import on in this case? | 09:11:39 |
accelbread | Ah, that module sets nixDir to .. You shouldn't need that module though | 14:18:00 |
Zhenxing He | Oh, yes, change nixDir back works, could you please explain why set nixDir to . in that module? | 21:34:30 |
accelbread | that specific module is intended for repos that just export a flakelight module, like flakelight-rust, so it sets that since not much point in the folder in a nix-only repo | 22:52:12 |
Zhenxing He | I am not quite sure if my understanding is correct, but I think it should be reasonable and convenient to support both, as in my case, I'd like to use the flakelightModule feature so that the user of my flake will only need to add one input, no need to also add flakelight or home-manager, etc. and at the same time, I can add hosts and test in my flake directly, without the need of another flake. | 23:31:18 |
accelbread | i think theres some confusion here; those are two different things | 23:39:35 |
accelbread | you dont need the flakelight.flakelightModules.flakelightModule module for that | 23:40:49 |