nixos-generate-config: substitute bcachefs (#510314)

This commit is contained in:
Sandro 2026-05-13 23:53:26 +00:00 committed by GitHub
commit 2cbff54512
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View file

@ -505,7 +505,7 @@ EOF
# This should work for single and multi-device systems.
# still needs subvolume support
if ($fsType eq "bcachefs") {
my ($status, @info) = runCommand("bcachefs fs usage $rootDir$mountPoint");
my ($status, @info) = runCommand("@bcachefs@ fs usage $rootDir$mountPoint");
my $UUID = $info[0];
if ($status == 0 && $UUID =~ /^Filesystem:[ \t\n]*([0-9a-z-]+)/) {

View file

@ -30,15 +30,20 @@ let
name = "nixos-generate-config";
src = ./nixos-generate-config.pl;
replacements = {
perl = "${
perl = lib.getExe (
pkgs.perl.withPackages (p: [
p.FileSlurp
p.ConfigIniFiles
])
}/bin/perl";
);
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
detectvirt = lib.getExe' config.systemd.package "systemd-detect-virt";
bcachefs =
if pkgs.bcachefs-tools.meta.broken then
lib.getExe' pkgs.coreutils "false"
else
lib.getExe pkgs.bcachefs-tools;
btrfs = lib.getExe pkgs.btrfs-progs;
inherit (config.system.nixos-generate-config) configuration desktopConfiguration flake;
xserverEnabled = config.services.xserver.enable;
};