I installed NixOS using the automated installer, and I chose btrfs as file type for the root partition.
When I look in “hardware-configuration.nix” I don’t see subvolumes.
But when I look in Btrfs Assistant, I see several subvolumes.
I am a bit confused, because the last time I did a btrfs installation, the subvolumes were declared in the hardware config.
I want a home subvolume so I can do snapshots of it with btrbk
but my snapshots are not working.
Maybe the problem is that home is top level, and not nested? If so, can I fix that? Or is it reinstall time?
sudo btrfs subvolume list -p /
ID 256 gen 484 parent 5 top level 5 path @
ID 257 gen 10 parent 5 top level 5 path @home
ID 258 gen 105 parent 256 top level 256 path srv
ID 259 gen 68 parent 256 top level 256 path var/lib/portables
ID 260 gen 68 parent 256 top level 256 path var/lib/machines
ID 261 gen 483 parent 256 top level 256 path tmp
ID 262 gen 438 parent 256 top level 256 path var/tmp
This is from Btrfs Assistant:
@
@/srv
@/tmp
@/var/lib/machines
@/var/lib/portables
@/var/lib/tmp
@home
This is from 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" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/cb2aa1d9-ae1f-4aba-b0be-d4151a1bb8e3";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd" ];
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/AF3A-CA43";
fsType = "vfat";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s20f0u3u1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}