!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

617 Members
NixOS ❤️ systemd171 Servers

Load older messages


SenderMessageTime
23 Jan 2025
@matthewcroughan:defenestrate.itmatthewcroughan and be like /device = "/store.squashfs"; 02:54:00
@matthewcroughan:defenestrate.itmatthewcroughan * and be like device = "/store.squashfs"; 02:54:15
@elvishjerricco:matrix.orgElvishJerriccothere's a very weird thing where initrd tries to nuke its own ramfs's contents before it does switch-root02:55:12
@elvishjerricco:matrix.orgElvishJerriccoso no02:55:14
@elvishjerricco:matrix.orgElvishJerricco though I guess /run/store.squashfs is probably a tad more appropriate 02:55:27
@elvishjerricco:matrix.orgElvishJerricco and /run gets move-mounted in between stage 1 and stage 2 02:55:46
@matthewcroughan:defenestrate.itmatthewcroughan /run or /sysroot/run? 02:55:53
@elvishjerricco:matrix.orgElvishJerricco just /run to make things easy. That way you don't even need the RequiresMountsFor=/sysroot/yaddayadda 02:56:15
@elvishjerricco:matrix.orgElvishJerriccowait02:56:25
@elvishjerricco:matrix.orgElvishJerricconevermind02:56:26
@elvishjerricco:matrix.orgElvishJerriccowait, nevermind again, that'll work :P02:56:33
@matthewcroughan:defenestrate.itmatthewcroughanThis is a clustrerfuck02:57:06
@matthewcroughan:defenestrate.itmatthewcroughan * This is a clusterfuck02:57:08
@elvishjerricco:matrix.orgElvishJerricco
    fileSystems."/nix/store" = {
      device = "/run/store.squashfs";
      fsType = "squashfs";
      options = [ "loop" ];
    };

    boot.initrd.systemd.services.copytoram = {
      before = [ "sysroot-nix-store.mount" ];
      after = [ "dev-disk-by\\x2dpartlabel-nix\\x2dstore.device" ];
      requires = [ "dev-disk-by\\x2dpartlabel-nix\\x2dstore.device" ];
      serviceConfig.ExecStart = "${pkgs.coreutils}/bin/dd if=/dev/disk/by-partlabel/nix-store of=/run/store.squashfs";
      serviceConfig.Type = "oneshot";
      requiredBy = [ "initrd.target" ];
    };
02:57:08
@matthewcroughan:defenestrate.itmatthewcroughanbut in the end, it does produce some nice readable code02:57:14
@matthewcroughan:defenestrate.itmatthewcroughanI can't believe how much of a clusterfuck it can be though02:57:19
@elvishjerricco:matrix.orgElvishJerriccoyea, systemd initrd gets a little tricky02:57:20
@elvishjerricco:matrix.orgElvishJerriccobecause it makes everything extremely explicit02:57:37
@matthewcroughan:defenestrate.itmatthewcroughanWhen I look at stuff like this, I think it's a miracle things work so well02:57:39
@matthewcroughan:defenestrate.itmatthewcroughanBut it's even more fragile in the initrd shell scripts that came before hand02:57:59
@matthewcroughan:defenestrate.itmatthewcroughanThese images are really quite nice to build as wel02:58:34
@matthewcroughan:defenestrate.itmatthewcroughan * These images are really quite nice to build as well02:58:36
@matthewcroughan:defenestrate.itmatthewcroughan I guess you can still nixos-rebuild switch this setup, since /boot is left in tact 02:58:53
@matthewcroughan:defenestrate.itmatthewcroughanas long as you have enough ram 🤔02:58:58
@elvishjerricco:matrix.orgElvishJerriccowell, you'll need a writable store for that02:59:16
@elvishjerricco:matrix.orgElvishJerriccowhich means overlayfs shenanigans02:59:23
@matthewcroughan:defenestrate.itmatthewcroughan I was reading about systemd switch root stuff, and it has a soft switch mode 03:00:39
@elvishjerricco:matrix.orgElvishJerriccoyou mean soft-reboot?03:00:55
@elvishjerricco:matrix.orgElvishJerricco that's complicated 03:01:00
@matthewcroughan:defenestrate.itmatthewcroughan soft-reboot yeah 03:01:05

Show newer messages


Back to Room ListRoom Version: 6