!oNSIfazDqEcwhcOjSL:matrix.org

disko

364 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko92 Servers

Load older messages


SenderMessageTime
6 Jan 2025
@raj-magesh:matrix.orgRaj *

Sorry, mini-bump:

I'm trying to use the disko-install command to create a custom bootable USB that has an entire NixOS system (including persistent storage and access to git and neovim, plus a few other goodies).

After running sudo nix run 'github:nix-community/disko/latest#disko-install' -- --flake .#image --disk os /dev/sdc, things seem to get built/copied etc., but it finally halts with this error:

efiSysMountPoint = '/boot' is not a mounted partition. Is the path configured correctly?
Traceback (most recent call last):
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 431, in <module>
    main()
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 411, in main
    run([CHECK_MOUNTPOINTS])
  File "/nix/store/diy6lcklb9r4k18l6plg6yj9chn3pg19-systemd-boot/bin/systemd-boot", line 58, in run
    return subprocess.run(cmd, check=True, text=True, stdout=stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/c9m6yd8fg1flz2j5r4bif1ib5j20a0cy-python3-3.12.8/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/nix/store/686vaqa40l0vxcp1ll54cbvlrmn9kn55-check-mountpoints']' returned non-zero exit status 1.
Failed to install bootloader
disko-install failed
rmdir: failed to remove '/mnt/disko-install-root': Directory not empty

My disko (and NixOS configuration) is pretty simple and the problem occurs even with a minimal configuration:

{
  disko.devices = {
    nodev."/" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=755"
      ];
    };
    nodev."/home/raj" = {
      fsType = "tmpfs";
      mountOptions = [
        "size=2G"
        "defaults"
        "mode=777"
      ];
    };
    disk = {
      os = {
        imageName = "nixos-usb-stick";
        imageSize = "60G";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              priority = 0;
              end = "1G";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["defaults" "umask=0077"];
              };
            };
            root = {
              priority = 1;
              end = "-0";
              content = {
                type = "luks";
                name = "root";
                initrdUnlock = true;
                extraFormatArgs = ["--pbkdf argon2id"];
                content = {
                  type = "btrfs";
                  extraArgs = ["-f"];
                  subvolumes = {
                    "/nix" = {
                      mountpoint = "/nix";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/persist" = {
                      mountpoint = "/persist";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                    "/data" = {
                      mountpoint = "/data";
                      mountOptions = ["compress=zstd" "noatime"];
                    };
                  };
                };
              };
            };
          };
        };
      };
    };
  };
}

Is there anything obvious I'm missing?

19:29:14
7 Jan 2025
@rts-kaede:thewired.chかえでちゃん joined the room.11:42:04
@rts-kaede:thewired.chかえでちゃんHello, do disko supports luks2? I see documentation for luks but not luks211:43:40
@lassulus:lassul.uslassuluscryptsetup defaults to LUKS2, so we more or less only support LUKS211:51:35
@sigmasquadron:matrix.orgSigmaSquadron changed their display name from SigmaSquadron to SigmaSquadron (Away until 2024-01-12).19:35:51
@renato-trevisan:matrix.orgRenato Trevisan set a profile picture.21:58:46
9 Jan 2025
@intergalactic-turtle-fucker:arcticfoxes.netIntergalacticTurtleFucker changed their display name from IntergalacticTurtleFucker to ColdSideOfYourPillow.03:00:25
@intergalactic-turtle-fucker:arcticfoxes.netIntergalacticTurtleFucker changed their profile picture.03:00:33
@lgcl:lgcl.delgcl (she/they) joined the room.13:24:48
10 Jan 2025
@laurynasp:matrix.orglaurynasp joined the room.19:50:23
@sigmasquadron:matrix.orgSigmaSquadron changed their display name from SigmaSquadron (Away until 2024-01-12) to SigmaSquadron (Away until 2024-01-11).22:15:58
@sigmasquadron:matrix.orgSigmaSquadron changed their display name from SigmaSquadron (Away until 2024-01-11) to SigmaSquadron (Away until 2025-01-11).22:43:36
@zvzg:matrix.orgSáviohttps://github.com/nix-community/disko/pull/936 minor fix23:32:18
@zvzg:matrix.orgSáviohttps://github.com/nix-community/disko/pull/923/files I noticed this one. It's a significant typo, since it breaks the PostVM hook from working23:33:13
11 Jan 2025
@orzklv:matrix.orgOrzklv left the room.04:07:41
@nam3l33ss:matrix.org·☽•Nameless☆•777 · ± changed their profile picture.04:42:58
@intergalactic-turtle-fucker:arcticfoxes.netIntergalacticTurtleFucker removed their profile picture.10:09:00
@intergalactic-turtle-fucker:arcticfoxes.netIntergalacticTurtleFucker removed their display name ColdSideOfYourPillow.10:09:07
@intergalactic-turtle-fucker:arcticfoxes.netIntergalacticTurtleFucker left the room.10:09:38
@sigmasquadron:matrix.orgSigmaSquadron changed their display name from SigmaSquadron (Away until 2025-01-11) to SigmaSquadron.15:06:55
@10leej:matrix.org@10leej:matrix.org left the room.18:45:25
@pandapip1:matrix.orgpandapip1 joined the room.21:23:12
12 Jan 2025
@nakibrayane:matrix.orgRayane Nakib (ريّان نقيب) joined the room.12:38:51
@rts-kaede:thewired.chかえでちゃんDo disko supports getting the system RAM size and using that as the size of the swap partition?13:30:14
@lassulus:lassul.uslassulusMaybe with nixos-facter13:47:38
@rts-kaede:thewired.chかえでちゃん

Thank you for answering. Guess I am not messing with that then, more complex than I thought it would be.
Btw, just watched your talk on YouTube (NixCon2023)

  • How is the state for checking for partition alignment automatically? For example does it warn me when partition is not aligned?
  • I heard it is possible to use YubiKey with luks2 in disko, is there any documentation example for that?
14:18:47
13 Jan 2025
@rts-kaede:thewired.chかえでちゃん

Also, I have:

nixosConfigurations = {
      book-of-the-azure-sky = lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs.inputs = inputs;
        modules = [
          disko.nixosModules.disko
          <...disko-config.nix here...>
        ];

and disko-config.nix:

{
  device ? throw "Set this to your disk device, e.g. /dev/sda",
  ...
}: {
  disko.devices = {
    disk.main = {
      inherit device;
      type = "disk";
<...>

How to use disko-config.nix in modules and set the device in disko-config.nix to /dev/sdb?

22:23:20
14 Jan 2025
@zvzg:matrix.orgSávioIt seems diskoImagesScript is broken on nixpkgs master, as reported on https://github.com/nix-community/disko/issues/900#issuecomment-2556781723 I have run into the same issue, and I tried to fix it. Ever since vmRunCommand started depending on the Nix build environment and the switch from 9p to virtiofs, it has become awkward to make it work. The generated script doesn't run in the Nix build environment, so the only way I found to do it was saving the environment at build time and loading it in the script. It works, but it's a hack. Then I found out virtiofsd must be run as root or as fake root in a user namespace, which requires some code changes. diskoImages still works fine though. Is diskoImagesScript still supported?04:25:20
@zvzg:matrix.orgSávio* It seems diskoImagesScript is broken on nixpkgs master, as reported at https://github.com/nix-community/disko/issues/900#issuecomment-2556781723 I have run into the same issue, and I tried to fix it. Ever since vmRunCommand started depending on the Nix build environment and the switch from 9p to virtiofs, it has become awkward to make it work. The generated script doesn't run in the Nix build environment, so the only way I found to do it was saving the environment at build time and loading it in the script. It works, but it's a hack. Then I found out virtiofsd must be run as root or as fake root in a user namespace, which requires some code changes. diskoImages still works fine though. Is diskoImagesScript still supported?04:26:13
@dustee:matrix.orgdusteeRedacted or Malformed Event16:39:50

Show newer messages


Back to Room ListRoom Version: 10