From 05fd786f8fc2616f3c0cd53b7e76d9b6c9a1919e Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 14 Apr 2025 11:50:04 +0200 Subject: pkgs/ll: Migrate to `writeShellApplication` --- pkgs/by-name/ll/ll/ll.sh | 8 ++++---- pkgs/by-name/ll/ll/package.nix | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/ll/ll/ll.sh b/pkgs/by-name/ll/ll/ll.sh index 73328e3e..3fb8d9aa 100755 --- a/pkgs/by-name/ll/ll/ll.sh +++ b/pkgs/by-name/ll/ll/ll.sh @@ -1,9 +1,10 @@ #!/usr/bin/env dash -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH - last_directory="$(mktemp)" +cleanup() { + rm "$last_directory" +} +trap cleanup EXIT command lf -last-dir-path="$last_directory" "$@" @@ -15,5 +16,4 @@ else die "$dir does not exist!" fi -rm "$last_directory" # vim: ft=sh diff --git a/pkgs/by-name/ll/ll/package.nix b/pkgs/by-name/ll/ll/package.nix index 4c13b40e..1516c51c 100644 --- a/pkgs/by-name/ll/ll/package.nix +++ b/pkgs/by-name/ll/ll/package.nix @@ -1,9 +1,7 @@ -{sysLib}: -sysLib.writeShellScript { +{writeShellApplication}: +writeShellApplication { name = "ll"; - src = ./ll.sh; - generateCompletions = false; + text = builtins.readFile ./ll.sh; - # `ll` must be able to change the path of the running shell. - wrap = false; + inheritPath = true; } -- cgit 1.4.1