nixos-generate-config: substitute bcachefs

For systems where the package is marked as broken, use `false` instead.
The Perl script checks for a non-zero exit status, so it will handle it
as if the command failed.
This commit is contained in:
beviu
2026-04-15 16:07:29 +02:00
parent 8b7658bfa5
commit 623ec633ba
2 changed files with 6 additions and 1 deletions
@@ -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-]+)/) {
+5
View File
@@ -38,6 +38,11 @@ let
);
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
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;