diff --git a/default.nix b/default.nix index 82d4a852..f19ff107 100644 --- a/default.nix +++ b/default.nix @@ -15,19 +15,6 @@ stdenv.mkDerivation rec { libsodium libscrypt ]; - patchPhase = '' - # ensure the mkfs and fsck scripts, which are just wrappers around - # 'bcachefs', are patched to refer to the right location inside the - # nix store. (you wouldn't expect built tools to call random outside - # utilities, in general, but the exact tools they were built with.) - # - # TODO FIXME: it would be better to fix this in the 'install' target, - # however, so this works with any bog-standard installation - - substituteInPlace fsck.bcachefs --replace bcachefs $out/bin/bcachefs - substituteInPlace mkfs.bcachefs --replace bcachefs $out/bin/bcachefs - ''; - enableParallelBuilding = true; makeFlags = [ "PREFIX=$(out)" diff --git a/fsck.bcachefs b/fsck.bcachefs index e1d2a44c..1494e4c1 100755 --- a/fsck.bcachefs +++ b/fsck.bcachefs @@ -1,3 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash -exec bcachefs fsck "$@" +SDIR="$(dirname "$(readlink -f "$0")")" +exec "$SDIR/bcachefs" fsck "$@" diff --git a/mkfs.bcachefs b/mkfs.bcachefs index a1ce6159..a0541d52 100755 --- a/mkfs.bcachefs +++ b/mkfs.bcachefs @@ -1,3 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash -exec bcachefs format "$@" +SDIR="$(dirname "$(readlink -f "$0")")" +exec "$SDIR/bcachefs" format "$@"