fix for cross-compile

This commit is contained in:
Kaz Wesley 2021-10-07 21:41:28 -07:00
parent fb85a3fe9e
commit c3737f28f2

View file

@ -40,25 +40,28 @@ let
stateDir = "/var/lib/dovecot";
pipeBin = pkgs.stdenv.mkDerivation {
name = "pipe_bin";
src = ./dovecot/pipe_bin;
buildInputs = with pkgs; [ makeWrapper coreutils bash rspamd ];
buildCommand = ''
mkdir -p $out/pipe/bin
cp $src/* $out/pipe/bin/
chmod a+x $out/pipe/bin/*
patchShebangs $out/pipe/bin
pipeBin_ = { makeWrapper, coreutils, bash, rspamd }:
pkgs.stdenv.mkDerivation {
name = "pipe_bin";
src = ./dovecot/pipe_bin;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ coreutils bash rspamd ];
buildCommand = ''
mkdir -p $out/pipe/bin
cp $src/* $out/pipe/bin/
chmod a+x $out/pipe/bin/*
patchShebangs $out/pipe/bin
for file in $out/pipe/bin/*; do
wrapProgram $file \
--set PATH "${pkgs.coreutils}/bin:${pkgs.rspamd}/bin"
done
'';
};
for file in $out/pipe/bin/*; do
wrapProgram $file \
--set PATH "${coreutils}/bin:${rspamd}/bin"
done
'';
};
pipeBin = pkgs.callPackage pipeBin_ { };
genPasswdScript = pkgs.writeScript "generate-password-file" ''
#!${pkgs.stdenv.shell}
#!${pkgs.runtimeShell}
set -euo pipefail