]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
nix: add bcachefs-fuse package
authorFinn Behrens <me@kloenk.de>
Sun, 19 Nov 2023 21:13:14 +0000 (22:13 +0100)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 20 Nov 2023 20:13:17 +0000 (15:13 -0500)
Add a fuseSupport argument and bcachefs-fuse as flake output with fuse enabled.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
build.nix
flake.nix

index e05dad4243c1f42657099e0b3fdf00de3958985c..831c7e9f1e4d2f9db6818d272888f6589b384721 100644 (file)
--- a/build.nix
+++ b/build.nix
@@ -1,5 +1,6 @@
 { lib, stdenv, pkg-config, attr, libuuid, libsodium, keyutils, liburcu, zlib
-, libaio, udev, zstd, lz4, nix-gitignore, rustPlatform, rustc, cargo, }:
+, libaio, udev, zstd, lz4, nix-gitignore, rustPlatform, rustc, cargo, fuse3
+, fuseSupport ? false, }:
 let
   src = nix-gitignore.gitignoreSource [ ] ./.;
 
@@ -30,7 +31,9 @@ in stdenv.mkDerivation {
     zlib # zlib1g
     attr
     udev
-  ];
+  ] ++ lib.optional fuseSupport fuse3;
+
+  BCACHEFS_FUSE = if fuseSupport then "1" else "";
 
   cargoRoot = "rust-src";
   # when git-based crates are updated, run:
index c4185e77eac03aadec9497c2ea0abaedef400096..b8f9ce58d01f413fd2c6ca8dbfe47c6674e3b6b8 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -23,6 +23,7 @@
       in {
         packages = {
           inherit (pkgs) bcachefs;
+          bcachefs-fuse = pkgs.bcachefs.override { fuseSupport = true; };
           default = pkgs.bcachefs;
         };