Nix Flakes | 859 Members | |
| 177 Servers |
| Sender | Message | Time |
|---|---|---|
| 8 May 2025 | ||
just don't pass it lib, config, etc | 11:27:18 | |
| modules are supposed to be a function | 11:27:30 | |
| ideally, module inputs can be set through options | 11:29:09 | |
| How would that be done? | 11:29:44 | |
| https://nixos.org/manual/nixos/stable/#sec-writing-modules | 11:31:35 | |
| I don't see how that mentions passing options from a consuming flake to an imported home manager module. | 11:33:47 | |
| there is no mention of that because that has nothing to do with flakes | 11:34:20 | |
| when you have something like in a "consuming flake"
all three modules are on equal footing, they can each have | 11:36:12 | |
| * when you have something like in a "consuming flake"
all three modules are on equal footing, they can each have | 11:36:25 | |
do note that you can't have the value of an option affect the definition of options themselves (so, in short, no using config in imports or options) | 11:37:20 | |
Okay, I see. The problem I have is that I want to pass a custom variable to bar for example. | 11:37:33 | |
| that would be a cyclic dependency | 11:37:35 | |
| what is the argument used for? | 11:38:32 | |
That would be the folder of the consuming flake, because the imported home manager module should provide a nix-rebuild command which does home-manager switch --flake ${flakefolder}#main. flakefolder is the variable I want to pass downstream. | 11:40:11 | |
* That would be the folder of the consuming flake, because the imported home manager module should provide a nix-rebuild command which does home-manager switch --flake ${flakefolder}#main (and other corporate stuff). flakefolder is the variable I want to pass downstream. | 11:40:38 | |
| you would have something like
| 11:45:12 | |
| (note: untested) | 11:45:29 | |
| and then in your regular module you would set
| 11:45:49 | |
| this way the module works just like any other option you already have in home-manager | 11:48:58 | |
| Ah I see, thank you. | 11:51:22 | |
| 12:00:10 | ||
| So that would result in something like this?
| 12:39:13 | |
| 9 May 2025 | ||
| 03:23:08 | ||
| 10 May 2025 | ||
| 19:44:36 | ||
| 19:53:11 | ||
| 23:32:18 | ||
| 12 May 2025 | ||
| I have a bunch of eg.
in the flake for my systems, applied with But recently, github rate limits have been hitting me on like 100% of my | 16:35:42 | |
If I could set an access token on githubusercontent, it would work (eg. as in curl "https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/386205.patch?access_token=$GITHUB_TOKEN"), but I have no idea how to configure that without exposing the token directly in my flake.nix, which is a public file | 16:39:36 | |
| * I have a bunch of eg.
in the flake for my systems, applied with But recently, github rate limits have been hitting me on like 100% of my | 16:41:03 | |
In reply to @gsaurel:laas.frfor flake inputs you're in luck, you can set the access-tokens nix option | 17:04:03 | |