From 3ecfa2ea01c54a4d62067103d80a2ef2ca1df826 Mon Sep 17 00:00:00 2001 From: Calum MacRae Date: Mon, 7 Oct 2024 19:32:31 +0100 Subject: [PATCH] fix: Include coreutils in 'lock' app's environment This fixes an issue on Darwin systems where the native `install` command doesn't have a `-t` flag. Including `coreutils` in the script's runtimeInputs ensures that's the version of `install` the script uses, which fixes the problem. --- pkgs/emacs/lock/default.nix | 4 +++- pkgs/emacs/lock/write-lock-1.nix | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/emacs/lock/default.nix b/pkgs/emacs/lock/default.nix index f9188a7..3ca004b 100644 --- a/pkgs/emacs/lock/default.nix +++ b/pkgs/emacs/lock/default.nix @@ -3,6 +3,7 @@ nix, nixfmt-rfc-style, jq, + coreutils, runCommandLocal, writeTextFile, writeShellScript, @@ -96,7 +97,7 @@ in { type = "app"; program = (import ./write-lock-1.nix {inherit lib writeShellScript;} { - inherit outDir src postCommand; + inherit outDir src postCommand coreutils; }) .outPath; }; @@ -104,6 +105,7 @@ in { writerScript = {postCommandOnGeneratingLockDir}: writeShellApplication { name = "emacs-twist-write-lock"; + runtimeInputs = [ coreutils ]; text = builtins.replaceStrings [ "@lockSrcDir@" diff --git a/pkgs/emacs/lock/write-lock-1.nix b/pkgs/emacs/lock/write-lock-1.nix index 28bae42..b94a750 100644 --- a/pkgs/emacs/lock/write-lock-1.nix +++ b/pkgs/emacs/lock/write-lock-1.nix @@ -5,6 +5,7 @@ outDir, src, postCommand, + coreutils, }: writeShellScript "lock" '' outDir="${outDir}" @@ -27,7 +28,7 @@ writeShellScript "lock" '' fi done - install -m 644 -t "$outDir" ${src}/*.* + ${coreutils}/bin/install -m 644 -t "$outDir" ${src}/*.* ${lib.optionalString (postCommand != null) '' cd "$outDir"