!PSmBFWNKoXmlQBzUQf:helsinki-systems.de

Stage 1 systemd

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

Load older messages


SenderMessageTime
6 May 2023
@elvishjerricco:matrix.org@elvishjerricco:matrix.org mberndt: You might want to make a variant of the nixos installer test then 16:15:51
@elvishjerricco:matrix.org@elvishjerricco:matrix.orglook at `installer.nix16:15:54
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * look at `installer.nix` 16:15:55
@elvishjerricco:matrix.org@elvishjerricco:matrix.org * look at installer.nix 16:15:58
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgactually that's better for a bunch of reasons16:16:11
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgtesting actually installing nixos is way more comprehensive16:16:23
@mberndt:matrix.org@mberndt:matrix.orgThanks, I'll have a look16:16:29
@mberndt:matrix.org@mberndt:matrix.orgWhoa, that's more than 1k lines16:16:49
@elvishjerricco:matrix.org@elvishjerricco:matrix.org

fwiw, this does fix the lvm2 test:

diff --git a/nixos/tests/lvm2/systemd-stage-1.nix b/nixos/tests/lvm2/systemd-stage-1.nix
index b711cd22d7f..05f0e6eb76e 100644
--- a/nixos/tests/lvm2/systemd-stage-1.nix
+++ b/nixos/tests/lvm2/systemd-stage-1.nix
@@ -64,6 +64,7 @@ in import ../make-test-python.nix ({ pkgs, ... }: {
     virtualisation = {
       emptyDiskImages = [ 8192 8192 ];
       useBootLoader = true;
+      mountHostNixStore = true;
       useEFIBoot = true;
     };
     boot.loader.systemd-boot.enable = true;
16:16:57
@elvishjerricco:matrix.org@elvishjerricco:matrix.org
In reply to @mberndt:matrix.org
Whoa, that's more than 1k lines
yea well it's actually a bunch of tests in one
16:17:07
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgit includes variants for a whole lot of different storage mechanisms16:17:24
@elvishjerricco:matrix.org@elvishjerricco:matrix.orgmost of the logic isn't the important part; look at the specific tests it defines for each storage type16:17:59
@mberndt:matrix.org@mberndt:matrix.orgEven bcachefs, apparently16:18:01
@mberndt:matrix.org@mberndt:matrix.orgSo I guess the best way to test this is probably just to add another test to that file16:20:04
@elvishjerricco:matrix.org@elvishjerricco:matrix.org yea, though this will be the first one that only supports systemdStage1 = true 16:21:00
@elvishjerricco:matrix.org@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@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

Show newer messages


Back to Room ListRoom Version: 6