NixOS Module System | 167 Members | |
| 35 Servers |
| Sender | Message | Time |
|---|---|---|
| 23 Feb 2026 | ||
| 17:53:26 | ||
| 24 Feb 2026 | ||
| 07:41:18 | ||
| 10:36:54 | ||
| 12:56:48 | ||
| 25 Feb 2026 | ||
| 19:54:14 | ||
| 19:55:53 | ||
| 21:51:53 | ||
| 27 Feb 2026 | ||
`servers = mkOption { default = { }; description = '' Attribute set of wyoming-faster-whisper instances to spawn. ''; type = attrsOf (submodule { options = { enable = mkEnableOption "Wyoming faster-whisper server"; zeroconf = { enable = mkEnableOption "zeroconf discovery" // { default = true; }; name = mkOption { type = str; default = "faster-whisper-foo"; # how to replace foo with the attribute name? description = '' The advertised name for zeroconf discovery. ''; }; }; | 22:41:00 | |
| 22:41:09 | |
| how to reference the attribute name in inside the attrvalues? do we have a facility for that? 🤔 | 22:41:56 | |
| * how to reference the attribute name inside the attrvalue? do we have a facility for that? 🤔 | 22:42:06 | |
| Submodule can be a function. If you destructure 'name' the module system will provide it. | 22:53:18 | |
| If I am understanding the question correct | 22:53:36 | |
| submodule ({ name, ... }: ... } | 22:54:00 | |
| Or did you mean another attributeName? | 22:55:00 | |
| * submodule ({ name, ... }: ... your options }) | 22:57:09 | |
| in fact name is always available in submodules, but it needs to be explicitly destructured in functionargs of a module. If not destructured it's not passed. So a module like moduleArgs: { .... } won't have it | 22:59:46 | |
| nah, the servers.${name} = { // name in here | 23:10:04 | |
| ok, thx! | 23:10:14 | |
| 1 Mar 2026 | ||
| 01:16:46 | ||
| 2 Mar 2026 | ||
| 12:48:46 | ||
| 13:05:59 | ||
| 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 | |