!oNSIfazDqEcwhcOjSL:matrix.org

disko

355 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko89 Servers

Load older messages


SenderMessageTime
21 Apr 2025
@mjolnir:nixos.orgNixOS Moderation Bot banned @creepinson:matrix.org@creepinson:matrix.org (spam).04:53:43
22 Apr 2025
@mjolnir:nixos.orgNixOS Moderation Bot unbanned @creepinson:matrix.org@creepinson:matrix.org.02:28:45
@creepinson:matrix.org@creepinson:matrix.org joined the room.02:41:04
@senorsmile:matrix.orgsenorsmile joined the room.02:51:48
@jaredmontoya:matrix.orgjaredmontoya joined the room.09:32:35
@phaer:matrix.orgphaer

Hm... between two vms, that shouldn't be an issue if networking.hostId is the same for both.

For diskoImagesScript i believe the idea would be that it runs zfs export in the end which also should cause it to import cleanly on another system iiuc.

10:07:47
23 Apr 2025
@f44:matrix.orgf44Redacted or Malformed Event18:42:13
24 Apr 2025
@nicoty:kde.orgnicoty

The PR got merged 🎉 (thanks for your UUID contribution, btw), but I couldn't quite get subvolumes to mount at boot time.

I saw that your PR included code for a custom systemd unit. I haven't tried using that and haven't much experience with writing systemd units, so maybe you could try implementing something with it to get boot-time subvolume mounts to work, if you're interested?

23:32:42
25 Apr 2025
@nrs-status:matrix.orgthirdofmay18081814goya joined the room.16:10:02
@skarmux:matrix.orgNils (Skarmux) joined the room.18:00:35
26 Apr 2025
@nicoty:kde.orgnicoty @projectinitiative:matrix.org: Ignore my last message. Apparently the PR did allow subvolumes to be mounted at boot time and I just didn't implement the test properly to allow the test to unlock the subvolumes. This new PR fixes that though. So I think this means that we can probably now use bcachefs for impermanence, or we're at least one step closer to it 😀. 00:17:04
@nicoty:kde.orgnicoty* @projectinitiative:matrix.org: Ignore my last message. Apparently the PR did allow subvolumes to be mounted at boot time and I just didn't implement the test properly to allow it to unlock the subvolumes. [This new PR fixes that though](https://github.com/nix-community/disko/pull/1021). So I think this means that we can probably now use bcachefs for impermanence, or we're at least one step closer to it 😀.00:19:53
@lys:lys.ee@lys:lys.ee left the room.01:46:44
@disco_stick:matrix.orgfood style edible product changed their display name from High Dynamic Range to SS Bullshit Dreams to nowhere.02:22:05
@ruby:isincredibly.gayruby joined the room.14:42:27
@realhotgirlshit:envs.net@realhotgirlshit:envs.net joined the room.22:53:07
@realhotgirlshit:envs.net@realhotgirlshit:envs.netHey everyone22:53:39
@realhotgirlshit:envs.net@realhotgirlshit:envs.netI’m trying to create a BTRFS subvolumes on LUKS, and I’m wondering if the disko configuration I have is enough, or if I have to adjust the NixOS configuration:22:56:55
@realhotgirlshit:envs.net@realhotgirlshit:envs.net
      disko.nixosModules.disko
      {
        disko.devices = {
          main = {
            type = "disk";
            device = "/dev/vdb";
            content = {
              type = "gpt";
              partitions = {
                # Legacy BIOS, MBR-style partition table.
                boot = {
                  size = "1M";
                  type = "EF02"; # Grub MBR.
                };

                # The LUKS-encrypted root.
                luks = {
                  size = "300G";
                  content = {
                    type = "luks";
                    name = "crypted";

                    # Set up with an interactive password and not a keyfile.
                    settings = {
                      allowDiscards = true;
                    };

                    # The Btrfs filesystem.
                    content = {
                      type = "btrfs";
                      extraArgs = ["-f"]; # Overwrite any existing file system.
                      subvolumes = {
                        "/root" = {
                          mountpoint = "/";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The home subvolume.
                        "/home" = {
                          mountpoint = "/home";                          
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The nix subvolume.
                        "/nix" = {
                          mountpoint = "/nix";                          
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };
                      };
                    };
                  };
                };
              };
22:57:03
@lassulus:lassul.uslassulusShould be fine23:42:28
@realhotgirlshit:envs.net@realhotgirlshit:envs.netyayyy :D23:42:33
@realhotgirlshit:envs.net@realhotgirlshit:envs.netnot so hard23:42:37
27 Apr 2025
@realhotgirlshit:envs.net@realhotgirlshit:envs.net Copied from #Nix / NixOS :

I’m trying to set up LUKS–style Btrfs full disk encryption on my older BIOS desktop with a layout generated from disko. I try to install it, but I get an error that says installation of GRUB on /dev/sda failed: No such file or directory.

The command I used:
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run 'github:nix-community/disko/latest#disko-install' -- --flake '/etc/nixos#koolthing' --disk main /dev/sda

The relevant NixOS configuration:

# Disable UEFI.
  boot.loader.systemd-boot.enable = false;

  # Use the GRUB 2 boot loader.
  boot.loader.grub.enable = true;
  boot.loader.grub.efiSupport = false;

  boot.loader.efi.canTouchEfiVariables = false;
  # boot.loader.grub.efiInstallAsRemovable = true;
  # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  # Define on which hard drive you want to install Grub.
  boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

The entire disko configuration in its flake:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
  inputs.disko.url = "github:nix-community/disko/latest";
  inputs.disko.inputs.nixpkgs.follows = "nixpkgs";

  outputs = {self, disko, nixpkgs }: {
    nixosConfigurations.koolthing = nixpkgs.legacyPackages.x86_64-linux.nixos [
      ./configuration.nix
      disko.nixosModules.disko
      {
        disko.devices = {
	  disk = {
          main = {
            type = "disk";
            device = "/dev/vdb";
            content = {
              type = "gpt";
              partitions = {
                # Legacy BIOS, MBR-style partition table.
                boot = {
                  size = "1M";
                  type = "EF02"; # Grub MBR.
                };

                # The LUKS-encrypted root.
                luks = {
                  size = "300G";
                  content = {
                    type = "luks";
                    name = "crypted";

                    # Set up with an interactive password and not a keyfile.
                    settings = {
                      allowDiscards = true;
                    };

                    # The Btrfs filesystem.
                    content = {
                      type = "btrfs";
                      extraArgs = ["-f"]; # Overwrite any existing file system.
                      subvolumes = {
                        "/root" = {
                          mountpoint = "/";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The home subvolume.
                        "/home" = {
                          mountpoint = "/home";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };

                        # The nix subvolume.
                        "/nix" = {
                          mountpoint = "/nix";
                          mountOptions = [
                            "compress=zstd"
                            "noatime"
                          ];
                        };
                      };
                    };
                  };
                };
              };
            };
          };
	};
        };
      }
    ];
  };
}
08:29:02
@realhotgirlshit:envs.net@realhotgirlshit:envs.netI’m pretty sure /dev/sda was listed in lsblk hmm I can check a little later08:30:41
@vengmark2:matrix.orgl0b0 Which disk devices do you have? Usually they match /dev/sd* or /dev/nvme*. 08:31:19
@realhotgirlshit:envs.net@realhotgirlshit:envs.net I have a 465.8 GB SSD showing up as /dev/sda, and it has a BIOS partition /dev/sda1, and a root partition that doesn’t take up the whole drive, just 300 GB 08:55:18
@vengmark2:matrix.orgl0b0 You do have device = "/dev/vdb"; in your configuration though. Not sure how that interacts with the CLI. 08:56:50
@vengmark2:matrix.orgl0b0 Why do I have to specify--disk NAME PATH when those are already in the configuration? 08:57:49
@vengmark2:matrix.orgl0b0 * Why do I have to specify--disk NAME DEVICE when those are already in the configuration? 08:57:57
@vengmark2:matrix.orgl0b0 * Why do I have to specify --disk NAME DEVICE when those are already in the configuration? 08:58:03

Show newer messages


Back to Room ListRoom Version: 10