12 Jun 2025 |
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 |
accelbread | lets say a flake named flakeA wants to set a default input named aaa and flakeB wants to use it.
flakeA sets:
flakelightModule = { lib, ... }: {
inputs.aaa = lib.mkDefault aaa;
}
flakeB sets imports = [ flakeA.flakelightModules.default ]; | 23:45:58 |
accelbread | * lets say a flake named flakeA wants to set a default input named aaa and flakeB wants to use it.
flakeA sets:
```
flakelightModule = { lib, ... }: {
inputs.aaa = lib.mkDefault aaa;
}
```
flakeB sets:
```
imports = [ flakeA.flakelightModules.default ];
```
| 23:47:16 |
accelbread | that should be all that is needed | 23:48:13 |
Zhenxing He | What if I wont to be able to do something like this in flakeB:
{
inputs.flakeA.url = "/path/to/flakeA";
outputs = inputs: inputs.flakeA ./. {};
}
| 23:51:31 |
Zhenxing He | * What if I want to be able to do something like this in flakeB:
{
inputs.flakeA.url = "/path/to/flakeA";
outputs = inputs: inputs.flakeA ./. {};
}
| 23:51:52 |
Zhenxing He | and in flakeB, it will get default for inputs.aaa and others. | 23:53:20 |
Zhenxing He | * What if I want to be able to do something like this in flakeB:
{
inputs.flakeA.url = "/path/to/flakeA";
outputs = inputs: inputs.flakeA ./. { inherit inputs; };
}
| 23:54:40 |
13 Jun 2025 |
Zhenxing He | in flakeA, I did something like this:
{
inputs = {...};
outputs = inputs:
flakelight ./. {
imports = [
flakelight.flakelightModules.flakelightModule
./myfeature.nix
];
flakelightModule = {lib, ...}: {
imports = [./myfeature.nix];
inputs.flakelight = lib.mkDefault flakelight;
inputs.home-manager = lib.mkDefault home-manager;
};
};
}
| 00:42:36 |
Zhenxing He | And it seems work as expected, but I am not sure if this is the right way to go. | 00:44:38 |
accelbread | Redacted or Malformed Event | 02:03:51 |
accelbread | also don't need to set inputs.flakelight (flakelight already sets this) | 02:05:11 |
accelbread | ah yeah you want the module to make it directly callable | 02:06:21 |
accelbread | hmm | 02:07:48 |
accelbread | Maybe should remove the setting of nixDir from flakelight.flakelightModules.flakelightModule | 02:09:48 |
Zhenxing He | Yeah, make it callable looks very neat and cool, love this feature! | 02:11:57 |
accelbread | yeah, the functor config lets you set the function for when the flake is called. that module sets it to an extended mkFlake | 02:14:20 |
accelbread | yeah, i'll push an update to have it not set nixDir to . when I get back home | 02:15:06 |
Zhenxing He | Great, thx, not in a hurry, I can work around by setting nixDir manuallly. | 02:16:17 |
16 Jun 2025 |
accelbread | I've updated the module to not set nixDir
As a heads-up, I also renamed flakelight.flakelightModules.flakelightModule to flakelight.flakelightModules.extendFlakelight since the old name was a bit confusing | 02:35:44 |
Zhenxing He | Great, thx! | 02:56:26 |
21 Jun 2025 |
| Niclas Overby Ⓝ joined the room. | 11:36:41 |