Howdy –
I’m trying to test a new Nix module for some btrfs-only software (specifically, beesd
– a block-level deduplicator for btrfs, as opposed to the existing file-level deduplicator already in the repo).
When I run nixos-rebuild build-vm
, the resulting guest has an ext4 root. This is true even when my nixos-config
provided is passed as follows:
{ config, pkgs, ... }: {
# attempting to override ext4-specific configuration from https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/qemu-vm.nix#L416-L430
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.btrfs-progs}/bin/mkfs.btrfs
'';
boot.initrd.postDeviceCommands = ''
mkfs.btrfs -L vmdisk ${config.virtualisation.bootDevice}
'';
fileSystems."/" = { label = "vmdisk"; fsType = "btrfs"; };
users.users.root.initialPassword = "root";
## commented for public post
## to test this, you need the nixpkgs branch at https://github.com/charles-dyfis-net/nixpkgs/commit/33267abde4c60e3feba97205d8b78e8b86c0f75e
#services.beesd.filesystems."root" = { # FIXME: Would have used the spec as the key, if we knew how to do systemd escaping from nix
# spec = "LABEL=vmdisk";
# hashTableSizeMB = 256;
#};
system.stateVersion = "18.03";
}
Is there a reasonable override mechanism?
(BTW, while I’ll be submitting the module at https://github.com/charles-dyfis-net/nixpkgs/commit/33267abde4c60e3feba97205d8b78e8b86c0f75e for formal review as part of a pull request once it’s better-tested, any feedback on offer while it’s in this earlier stage would be very much appreciated).