about summary refs log tree commit diff stats
path: root/pkgs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-14 11:50:04 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-14 11:50:04 +0200
commit05fd786f8fc2616f3c0cd53b7e76d9b6c9a1919e (patch)
tree5b925b642c0092369998d89284088c2382646a71 /pkgs
parentpkgs/hibernate: Migrate to `writeShellApplication` (diff)
downloadnixos-config-05fd786f8fc2616f3c0cd53b7e76d9b6c9a1919e.zip
pkgs/ll: Migrate to `writeShellApplication`
Diffstat (limited to 'pkgs')
-rwxr-xr-xpkgs/by-name/ll/ll/ll.sh8
-rw-r--r--pkgs/by-name/ll/ll/package.nix10
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;
 }