NixOS Module System | 148 Members | |
| 29 Servers |
| Sender | Message | Time |
|---|---|---|
| 4 May 2024 | ||
| 11:27:03 | ||
| 11:27:13 | ||
| 21:03:46 | ||
| 8 May 2024 | ||
| 11:57:41 | ||
| 9 May 2024 | ||
| 17:11:29 | ||
| 14 May 2024 | ||
| 15:44:45 | ||
| 17:44:47 | ||
| 17:53:10 | ||
| 16 May 2024 | ||
| 06:19:54 | ||
| 20 May 2024 | ||
| 00:05:44 | ||
| 21 May 2024 | ||
if I want to pass a whole NixOS configuration (a nixosConfigurations.<whatever> flake output) to a module, what type should I say it is? does a top-level configuration have a type represented in Nixpkgs lib.types? | 02:27:09 | |
can I do better than types.attrs? | 02:27:58 | |
| the output of a NixOS configuration depends on what is being configured, so the "type" is dependent on what is being configured. This is what submodules are | 09:17:09 | |
| submodules are a non-evaluated set of modules which would be evaluated to compute the result. | 09:17:39 | |
| If you look at the various virtualisation options, you will find some which are re-importing NixOS modules, or suggesting to make mutation to the system configuration IIRC | 09:18:41 | |
| 22 May 2024 | ||
| 15:25:50 | ||
| 15:28:05 | ||
| 21:36:24 | ||
| 22:19:53 | ||
| 22:21:14 | ||
| 22:35:31 | ||
| 22:37:11 | ||
| 23 May 2024 | ||
| 01:31:17 | ||
| 01:31:27 | ||
| 26 May 2024 | ||
| I want to have several profile configs that all import the same base profile config or nixosModules, but I'd like to be able to import multiple of them simultaneously, which results in an error. My goal is to have each profile work as a fully standalone unit, but also be granularly composable into more featured profiles. Is there some pattern that would allow this organization scheme? | 10:34:14 | |
| If Is there some behavior of the module system that depends on being able to apply the same import multiple times while building the options attrset? | 10:37:03 | |
| Sam Lehman: do you have some example code you could link to? | 14:31:39 | |
| 27 May 2024 | ||
In reply to@lehmanator:tchncs.deProbably the easiest way to accomplish something like this would be to have all of the profiles imported, but control what gets applied with options Something like: common:`nixoptions = { profile1 = lib.mkOption { type = lib.types.bool; default = false; }; profile2 = lib.mkOption { type = lib.types.bool; default = false; }; profile3 = lib.mkOption { type = lib.types.bool; default = false; }; }; config = { # Common config here }; And so on | 01:33:16 | |
| Probably the easiest way to accomplish something like this would be to have all of the profiles imported, but control what gets applied with options Something like: common:`nixoptions = { profile1 = lib.mkOption { type = lib.types.bool; default = false; }; profile2 = lib.mkOption { type = lib.types.bool; default = false; }; profile3 = lib.mkOption { type = lib.types.bool; default = false; }; }; config = { # Common config here }; `profile1: | 01:33:16 | |
| Matrix, why must you pain me | 01:33:24 | |