| 26 Apr 2025 |
| @lys:lys.ee left the room. | 01:46:44 |
| food style edible product changed their display name from High Dynamic Range to SS Bullshit Dreams to nowhere. | 02:22:05 |
| ruby joined the room. | 14:42:27 |
| @realhotgirlshit:envs.net joined the room. | 22:53:07 |
@realhotgirlshit:envs.net | Hey everyone | 22:53:39 |
@realhotgirlshit:envs.net | I’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 | 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 | Should be fine | 23:42:28 |
@realhotgirlshit:envs.net | yayyy :D | 23:42:33 |
@realhotgirlshit:envs.net | not so hard | 23:42:37 |
| 27 Apr 2025 |
@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 | I’m pretty sure /dev/sda was listed in lsblk hmm I can check a little later | 08:30:41 |
l0b0 | Which disk devices do you have? Usually they match /dev/sd* or /dev/nvme*. | 08:31:19 |
@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 |
l0b0 | You do have device = "/dev/vdb"; in your configuration though. Not sure how that interacts with the CLI. | 08:56:50 |
l0b0 | Why do I have to specify--disk NAME PATH when those are already in the configuration? | 08:57:49 |
l0b0 | * Why do I have to specify--disk NAME DEVICE when those are already in the configuration? | 08:57:57 |
l0b0 | * Why do I have to specify --disk NAME DEVICE when those are already in the configuration? | 08:58:03 |
@realhotgirlshit:envs.net | Oh okay, I’ll take a look at that | 08:58:56 |
@realhotgirlshit:envs.net | Alright I fixed that in the disko configuration, but I’m still getting the error | 09:04:36 |
@realhotgirlshit:envs.net | Probably a good start though | 09:04:41 |
@realhotgirlshit:envs.net | I’ll see if I can mess with the GRUB configuration | 09:05:02 |
@realhotgirlshit:envs.net | I doubt nodev will work | 09:05:50 |
@realhotgirlshit:envs.net | Yeah, same thing | 09:07:55 |
@realhotgirlshit:envs.net | Got it to go through!
boot.loader.grub.enableCryptodisk = true | 09:15:19 |
@realhotgirlshit:envs.net | Now I probably just have to load a kernel module | 09:18:23 |
| mkg20001 joined the room. | 14:15:25 |
| musjj joined the room. | 14:43:05 |
musjj | Does it make sense to add additional fileSystems attribute for drives I don't want disko to manage/format like:
disko.devices.disk.main = { ... };
fileSystems = { ... };
Will this work correctly?
| 14:44:29 |
musjj | To clarify the filesystems I want to add lives on a different block device from disko's main disk. | 14:53:15 |