!JQvnJacrwKgtkGHYHO:matrix.org

NixOS + Framework

233 Members
Discussing NixOS in the context of the Framework laptop52 Servers

Load older messages


SenderMessageTime
10 May 2026
@sudoforge:matrix.orgsudoforgei guess, this is where the lvm-under-luks-before-your-fs comes into play17:51:13
@albertlarsan68:albertlarsan.frAlbert LarsanYou can only have a single hibernation swap, so add your ram and all other swap (including zram if you use that), add a little overhead, and you end up with 64GB of swap for 24 GB of RAM :)17:53:07
@sudoforge:matrix.orgsudoforgei have 64GiB of RAM (i bought it before the rampocalypse, don't hurt me) and haven't ran into issues with 72GiB17:55:19
@sudoforge:matrix.orgsudoforgebut yeah17:55:20
@albertlarsan68:albertlarsan.frAlbert LarsanGood for you, I really want to steal a 16G stick from another one of my laptops.17:56:31
@albertlarsan68:albertlarsan.frAlbert LarsanI only need like 16 on it (for The Sims 3)17:56:57
@sudoforge:matrix.orgsudoforgei do have 2x16GB SODIMM i have been puzzled about what i'd use it for17:58:56
@sudoforge:matrix.orgsudoforgeso, i mean17:59:13
@sudoforge:matrix.orgsudoforgei'd sell it if you need it. at a reasonable price (1 or two bitcoins)17:59:33
@sudoforge:matrix.orgsudoforge* i'd sell it if you need it. at a reasonable price (1 or 2 bitcoins)17:59:40
@albertlarsan68:albertlarsan.frAlbert LarsanDDR5 5600?18:00:46
@sudoforge:matrix.orgsudoforgeyep18:00:53
@albertlarsan68:albertlarsan.frAlbert LarsanMy FW runs at 4800 because the only stick of DDR5 I had available was a 8G DDR5 4800 from said other laptop from when I upgraded it to 32 GB of RAM18:02:03
@sudoforge:matrix.orgsudoforgeDM'ed ya, we can continue there18:03:19
@rajil:rajils.comtrumeeCan the swap partition be a btrfs subvolume and work for hibernate?18:20:19
@albertlarsan68:albertlarsan.frAlbert LarsanBtrfs subvolumes are, in some way, directories. They have some properties, like being snapshottable and mount those directories from the base hierarchy without having to resort to bind mounts. It would still be a swap file in a folder, with the hassle of finding the offset (although FWIH it seems easier on btrfs new)18:23:31
@rajil:rajils.comtrumee Ah ok, then I should use lvm to create a partition 18:27:06
@sudoforge:matrix.orgsudoforgeyeah, that'll be simpler and avoid the pitfalls of using a swap file18:30:59
@sudoforge:matrix.orgsudoforge

so you'll have (assuming you're adjusting to using a single luks container as discussed earlier):

/dev/nvme0n1p1 -> a fat32 partition for your esp
/dev/nvme0n1p2 -> a luks container
  lvm
    swap
    zfs for /
18:34:06
@rajil:rajils.comtrumee

sudoforge: i wiped out my laptop and trying to create btrfs system. Why does nix detect my home subvolume?,

[nix-shell:~]# btrfs subvolume list /mnt
ID 257 gen 24 top level 5 path root
ID 258 gen 10 top level 5 path home
ID 259 gen 10 top level 5 path nix

[nix-shell:~]# nixos-generate-config --show-hardware-config
# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usbhid" "uas" "sd_mod" ];
  boot.initrd.kernelModules = [ "dm-snapshot" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/mapper/cryptroot";
      fsType = "ext4";
    };

  boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/ca6a879a-b6a8-402d-a73a-8bf47982f3d6";

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/AF16-5E1D";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  fileSystems."/mnt" =
    { device = "/dev/mapper/pool-root";
      fsType = "btrfs";
      options = [ "subvol=root" ];
    };

  fileSystems."/mnt/boot" =
    { device = "/dev/disk/by-uuid/534B-D397";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  swapDevices =
    [ { device = "/dev/mapper/pool-swap"; }
    ];

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

20:29:29
@rajil:rajils.comtrumee *

sudoforge: i wiped out my laptop and trying to create btrfs system. Why does nix detect my home subvolume?,

[nix-shell:~]# btrfs subvolume list /mnt
ID 257 gen 25 top level 5 path root
ID 258 gen 10 top level 5 path home
ID 259 gen 10 top level 5 path nix

[nix-shell:~]# nixos-generate-config --root /mnt --show-hardware-config
# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usbhid" "uas" "sd_mod" ];
  boot.initrd.kernelModules = [ "dm-snapshot" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];

  fileSystems."/" =
    { device = "/dev/mapper/pool-root";
      fsType = "btrfs";
      options = [ "subvol=root" ];
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/534B-D397";
      fsType = "vfat";
      options = [ "fmask=0022" "dmask=0022" ];
    };

  swapDevices =
    [ { device = "/dev/mapper/pool-swap"; }
    ];

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

20:31:48
@albertlarsan68:albertlarsan.frAlbert LarsanIs the home subvolume actually mounted at /mnt/home?20:33:58
@rajil:rajils.comtrumee

This is my setup,

[nix-shell:~]# lsblk /dev/nvme1n1
NAME            MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
nvme1n1         259:1    0  1.8T  0 disk  
├─nvme1n1p1     259:2    0    2G  0 part  /mnt/boot
└─nvme1n1p2     259:3    0  1.8T  0 part  
  └─cryptdisk   254:3    0  1.8T  0 crypt 
    ├─pool-swap 254:4    0   98G  0 lvm   [SWAP]
    └─pool-root 254:5    0  1.7T  0 lvm   /mnt
20:33:58
@rajil:rajils.comtrumeelooks like i am missing a crucial step.20:34:46
@albertlarsan68:albertlarsan.frAlbert LarsanIf the subvolume isn’t mounted, then nix can’t infer that you want the home submodule at /home and the nix submodule at /nix20:35:01
@rajil:rajils.comtrumeehow do i mount the subvolume?20:35:15
@albertlarsan68:albertlarsan.frAlbert Larsan sudo mount -m -o subvol=home,noatime /dev/mapper/pool-root /mnt/home
sudo mount -m -o subvol=nix,noatime /dev/mapper/pool-root /mnt/nix
20:36:53
@sudoforge:matrix.orgsudoforgeah, albert got it out as i was responding :)20:37:31
@sudoforge:matrix.orgsudoforgealso, i'd strongly encourage you to use disko20:37:36
@albertlarsan68:albertlarsan.frAlbert LarsanDon’t forget to add noatime to the options in the generated nixos-hardware config, otherwise the SSD will get hammered by writes every time you read something20:37:59

Show newer messages


Back to Room ListRoom Version: 10