Btrfs subvolumes not listed in hardware config?

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? :face_with_open_eyes_and_hand_over_mouth:

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:


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"; = lib.mkDefault config.hardware.enableRedistributableFirmware;

This is the log for btrbk. It doesn’t see my home subvolume.

btrbk dryrun
WARNING: Skipping subvolume "/@home": Failed to fetch subvolume detail
WARNING: ... Command execution failed (exitcode=1)
WARNING: ... sh: sudo -n readlink -v -e '/@home'
WARNING: ... readlink: /@home: No such file or directory
Backup Summary (btrbk command line client, version 0.32.6)

    Date:   Sun Apr 28 13:56:59 2024
    Config: /etc/btrbk/btrbk.conf
    Dryrun: YES

    ===  up-to-date subvolume (source snapshot)
    +++  created subvolume (source snapshot)
    ---  deleted subvolume
    ***  received subvolume (non-incremental)
    >>>  received subvolume (incremental)
!!! Aborted: Failed to fetch subvolume detail

NOTE: Some errors occurred, which may result in missing backups!
Please check warning and error messages above.

NOTE: Dryrun was active, none of the operations above were actually executed!

If I remember correctly, my subvolumes were not automatically added to hardware-configuration.nix and I had to add them manually. Did you try that?

Well, I “successfully” created a snapshot of home, but now that I looked inside the snapshot, I see it is completely empty and has zero bytes.
Maybe the @home subvolume exists but is not populated?