!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

81 Members
systemd in NixOs's stage 1, replacing the current bash tooling https://github.com/NixOS/nixpkgs/projects/5125 Servers

Load older messages


SenderMessageTime
6 May 2023
@elvishjerricco:matrix.org@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@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@elvishjerricco:matrix.org (and make sure to add it to the list in installer-systemd-stage-1.nix) 16:23:29
@mberndt:matrix.org@mberndt:matrix.orgOh, neat16:31:29
@mberndt:matrix.org@mberndt:matrix.org Though I think I prefer something like // (if systemdStage1 then { stratisRoot = …; } else {}) 16:35:02
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat just means re-parenthesizing a big portion of the file16:36:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgwhich is kinda gross imo16:36:56
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgdoesn't really matter though16:36:59
@mberndt:matrix.org@mberndt:matrix.org Or // optionalAttrs systemdStage1 { stratisRoot = …; } 16:37:11
@mberndt:matrix.org@mberndt:matrix.orgWhy re-parenthesizing?16:37:40
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgoh, I guess there's no function being applied to the attrset so no parens necessary16:38:32
@arianvp:matrix.orgArianOmg it's so nice that systemd-analyze shows stage-1 delays now17:23:27
@arianvp:matrix.orgArianWith systemd initrd17:23:32
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat has been very nice yea17:23:50
@arianvp:matrix.orgArianMy NixOS VM boots in 4.8 seconds now17:24:08
@arianvp:matrix.orgArianWhich is very very nice17:24:12
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgi just wish systemd-analyze could do stuff like critical-chain for the initrd17:25:26
@arianvp:matrix.orgArianYeh it only seems to carry over device units18:00:55
@mberndt:matrix.org@mberndt:matrix.orgOK, I have another question18:57:20
@mberndt:matrix.org@mberndt:matrix.orgThis is indented with 6 spaces: https://github.com/NixOS/nixpkgs/blob/2b8f1156a80abc2fc5842f34bd38f197b0935c1b/nixos/tests/installer.nix#LL118C7-L118C718:58:24
@mberndt:matrix.org@mberndt:matrix.orgSo 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 right18:59:27
@k900:0upti.meK900No19:00:07
@k900:0upti.meK900 Nix strips indentation from multi-line strings 19:00:17
@mberndt:matrix.org@mberndt:matrix.orgOh19:00:27
@mberndt:matrix.org@mberndt:matrix.orgOK cool, so I don't need to worry about that19:00:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgyea empty lines are ignored for indentation purposes, but the first line is assumed to be indentation zero19:00:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgor something like that19:01:15
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgit's spelled out in the nix manual somewhere19:01:20
@mberndt:matrix.org@mberndt:matrix.orgwell presumably the least-indented line is going to be the one with zero indentation19:02:48
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgthat's probably correct :P19:03:00

Show newer messages


Back to Room ListRoom Version: 6