NixOS Module System | 159 Members | |
| 31 Servers |
| Sender | Message | Time |
|---|---|---|
| 14 Jan 2026 | ||
| 20:46:55 | |
| 17 Jan 2026 | ||
I can set internal on an option to make it usable only in nixpkgs. Is there any mechanism to do the opposite, where an option is unusable in-tree but still available to users? The use case is for an option that should be deprecated, but where the replacement is not yet stable enough to produce a warning and steer users toward it. But also, the replacement is widely used within nixpkgs already. | 02:25:32 | |
| warnings | 02:27:04 | |
internal doesn't not affect who can use an option. It only affects whether it is documented. It's effectively the same thing as visible = "shallow". | 12:30:52 | |
* internal doesn't affect who can use an option. It only affects whether it is documented. It's effectively the same thing as visible = "shallow". | 13:05:04 | |
| 18 Jan 2026 | ||
| 14:58:52 | ||
| 20:43:36 | ||
| 19 Jan 2026 | ||
| 21:20:37 | ||
| 21 Jan 2026 | ||
is there anything more specific than types.str I can use for a version number that I will later compare with lib.versionAtLeast? | 20:39:57 | |
| In string types we have The general solution is | 20:46:28 | |
yeah, I went with strMatching, but I was hoping to have a type matching exactly what versionAtLeast would accept, but I guess there's no such a thing | 20:50:21 | |
versionAtLeast under the hood uses builtins.compareVersions, which seems to accept anything, probably it has a last-resort method comparison that's just lexicographic comparison | 20:53:24 | |
| 22 Jan 2026 | ||
| I would say, at the very least types are part of the documentation, if you can give a more descriptive name even if there is no additional check, this might be worth it. (i-e. just aliasing the name my motivate someone else to add a check function later) | 11:28:54 | |
| 8 Feb 2024 | ||
| 10:38:02 | ||
| 15 Feb 2024 | ||
| 19:15:14 | ||
| 16 Feb 2024 | ||
| 14:56:15 | ||
| 14:59:24 | ||
| I recently stumbled upon similar issue when working on home-manager. https://discourse.nixos.org/t/is-it-possible-to-define-systemd-services-in-a-submodule/39538/5 The idea is that enabling https://nix-community.github.io/home-manager/options.xhtml#opt-programs.bash.enableCompletion should set I think that module system is missing an option to pass config options recursively up to all ancestors. | 15:06:01 | |
My idea is that nixos config could have a property extraNixosChildConfig and in home-manager bash module I could set _recurseAncestors = { extraNixosChildConfig = { environment.pathsToLink = [ ... ]; }; }. | 15:07:22 | |
| wdyt? | 15:07:26 | |
* My idea is that nixos config could have a property extraNixosChildConfig that gets merged with the rest of the config and in home-manager bash module I could set _recurseAncestors = { extraNixosChildConfig = { environment.pathsToLink = [ ... ]; }; }. | 15:07:44 | |
* My idea is that nixos config could pick up extraNixosChildConfig from childs and merge it with the rest of the config and in home-manager bash module I could set _recurseAncestors = { extraNixosChildConfig = { environment.pathsToLink = [ ... ]; }; }. | 15:08:21 | |
| Not sure about that recursive thing, that doesn't seem necessary, but yeah if there's something missing in the NixOS module for home-manager, that could be added | 15:34:09 | |
| Sounds like an issue for the home-manager repo | 15:34:16 | |
| Yeah, we could add it just for home-manager. But is seems like the issue is quite generic. See also https://github.com/NixOS/nixpkgs/pull/152785. | 15:51:50 | |
| Hmm yeah fair. I don't have the capacity to think a lot about this right now, it's a very intricate topic to wrap ones head around | 15:56:55 | |
| Yeah, I just wanted to bring the topic, maybe someone has some interesting thoughts. | 16:05:23 | |
| 17:49:31 | ||
| 20 Feb 2024 | ||
| I'm reading through the module system deep dive on nix.dev and am wondering if there is a behavioral difference between setting an options default behavior in the this
vs this
| 21:39:27 | |
djacu: Setting a default with options.foo = lib.mkOption { default = <value>; ... } is equivalent to config.foo = lib.mkOptionDefault <value>; | 23:23:21 | |