about summary refs log tree commit diff
path: root/pkgs/tools/filesystems/bcachefs-tools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/filesystems/bcachefs-tools/default.nix')
-rw-r--r--pkgs/tools/filesystems/bcachefs-tools/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/tools/filesystems/bcachefs-tools/default.nix b/pkgs/tools/filesystems/bcachefs-tools/default.nix
index 17b438ac46b8..f45e4b51953f 100644
--- a/pkgs/tools/filesystems/bcachefs-tools/default.nix
+++ b/pkgs/tools/filesystems/bcachefs-tools/default.nix
@@ -19,6 +19,7 @@
 , rustPlatform
 , makeWrapper
 , writeScript
+, python3
 , fuseSupport ? false
 }:
 
@@ -26,7 +27,6 @@ stdenv.mkDerivation (finalAttrs: {
   pname = "bcachefs-tools";
   version = "1.4.1";
 
-
   src = fetchFromGitHub {
     owner = "koverstreet";
     repo = "bcachefs-tools";
@@ -65,12 +65,12 @@ stdenv.mkDerivation (finalAttrs: {
     udev
   ] ++ lib.optional fuseSupport fuse3;
 
+  # FIXME: Try enabling this once the default linux kernel is at least 6.7
   doCheck = false; # needs bcachefs module loaded on builder
   checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
 
   makeFlags = [
-    "DESTDIR=${placeholder "out"}"
-    "PREFIX="
+    "PREFIX=${placeholder "out"}"
     "VERSION=${finalAttrs.version}"
     "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
   ];
@@ -79,6 +79,17 @@ stdenv.mkDerivation (finalAttrs: {
     rm tests/test_fuse.py
   '';
 
+  # Tries to install to the 'systemd-minimal' and 'udev' nix installation paths
+  installFlags = [
+    "PKGCONFIG_SERVICEDIR=$(out)/lib/systemd/system"
+    "PKGCONFIG_UDEVDIR=$(out)/lib/udev"
+  ];
+
+  postInstall = ''
+    substituteInPlace $out/libexec/bcachefsck_all \
+      --replace "/usr/bin/python3" "${python3}/bin/python3"
+  '';
+
   passthru = {
     tests = {
       smoke-test = nixosTests.bcachefs;