| 6 May 2023 |
@elvishjerricco:matrix.org | it includes variants for a whole lot of different storage mechanisms | 16:17:24 |
@elvishjerricco:matrix.org | most of the logic isn't the important part; look at the specific tests it defines for each storage type | 16:17:59 |
@mberndt:matrix.org | Even bcachefs, apparently | 16:18:01 |
@mberndt:matrix.org | So I guess the best way to test this is probably just to add another test to that file | 16:20:04 |
@elvishjerricco:matrix.org | yea, though this will be the first one that only supports systemdStage1 = true | 16:21:00 |
@elvishjerricco:matrix.org | so where you add the test, instead of something like this:
stratisRoot = ...
You probably need to do something like this:
${if systemdStage1 then "stratisRoot" else null} = ...
| 16:22:13 |
@elvishjerricco:matrix.org | nix is neat, so you can actually use an expression to evaluate a key name in an attrset if you put it in ${} | 16:22:32 |
@elvishjerricco:matrix.org | and if that expression evaluates to null it means not to add this attribute at all | 16:22:45 |
@elvishjerricco:matrix.org | (and make sure to add it to the list in installer-systemd-stage-1.nix) | 16:23:29 |
@mberndt:matrix.org | Oh, neat | 16:31:29 |
@mberndt:matrix.org | Though I think I prefer something like // (if systemdStage1 then { stratisRoot = …; } else {}) | 16:35:02 |
@elvishjerricco:matrix.org | that just means re-parenthesizing a big portion of the file | 16:36:51 |
@elvishjerricco:matrix.org | which is kinda gross imo | 16:36:56 |
@elvishjerricco:matrix.org | doesn't really matter though | 16:36:59 |
@mberndt:matrix.org | Or // optionalAttrs systemdStage1 { stratisRoot = …; } | 16:37:11 |
@mberndt:matrix.org | Why re-parenthesizing? | 16:37:40 |
@elvishjerricco:matrix.org | oh, I guess there's no function being applied to the attrset so no parens necessary | 16:38:32 |
Arian | Omg it's so nice that systemd-analyze shows stage-1 delays now | 17:23:27 |
Arian | With systemd initrd | 17:23:32 |
@elvishjerricco:matrix.org | that has been very nice yea | 17:23:50 |
Arian | My NixOS VM boots in 4.8 seconds now | 17:24:08 |
Arian | Which is very very nice | 17:24:12 |
@elvishjerricco:matrix.org | i just wish systemd-analyze could do stuff like critical-chain for the initrd | 17:25:26 |
Arian | Yeh it only seems to carry over device units | 18:00:55 |
@mberndt:matrix.org | OK, I have another question | 18:57:20 |
@mberndt:matrix.org | This is indented with 6 spaces:
https://github.com/NixOS/nixpkgs/blob/2b8f1156a80abc2fc5842f34bd38f197b0935c1b/nixos/tests/installer.nix#LL118C7-L118C7 | 18:58:24 |
@mberndt:matrix.org | So clearly that variable needs to expand into a block of statements that are also indented with 6 spaces, right? Because it's Python, so you have to get the indentation right | 18:59:27 |
K900 | No | 19:00:07 |
K900 | Nix strips indentation from multi-line strings | 19:00:17 |
@mberndt:matrix.org | Oh | 19:00:27 |