From c3737f28f29a6b0cb7738098a697b6a037b5539e Mon Sep 17 00:00:00 2001 From: Kaz Wesley Date: Thu, 7 Oct 2021 21:41:28 -0700 Subject: [PATCH] fix for cross-compile --- mail-server/dovecot.nix | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/mail-server/dovecot.nix b/mail-server/dovecot.nix index bc947ae..ee3b359 100644 --- a/mail-server/dovecot.nix +++ b/mail-server/dovecot.nix @@ -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