summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ripple/shell.nix20
1 files changed, 19 insertions, 1 deletions
diff --git a/ripple/shell.nix b/ripple/shell.nix
index cc9c44e..ce621fa 100644
--- a/ripple/shell.nix
+++ b/ripple/shell.nix
@@ -4,7 +4,21 @@
 
 with import ./nix;
 
-let inherit (gcc) cc; in
+let
+  inherit (gcc) cc;
+  # workaround for fusermount(1) getting shadowed by pkgs.fuse
+  # fusermount needs to be SUID-root to work, so nothing we can supply will suffice
+  # we have to pull it from the system environment instead
+  # NOTE: this has to go *before* pkgs.fuse in PATH
+  fusermount = writeShellScriptBin "fusermount" ''
+    IFS=:
+    for p in $PATH; do
+      [ -u "$p/fusermount" ] && exec "$p/fusermount" "$@"
+    done
+    echo cannot find SUID fusermount >&2
+    exit 1
+  '';
+in
 
 mkShell {
   packages = [
@@ -31,4 +45,8 @@ mkShell {
   PROTOC = "protoc";
 
   MINITRACE_CC1 = "${cc}/libexec/gcc/x86_64-unknown-linux-gnu/${cc.version}/cc1";
+
+  shellHook = ''
+    export PATH=${fusermount}/bin:$PATH
+  '';
 }