about summary refs log tree commit diff stats
path: root/pkgs/by-name/ll
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xpkgs/by-name/ll/ll/ll.sh16
-rw-r--r--pkgs/by-name/ll/ll/package.nix21
2 files changed, 28 insertions, 9 deletions
diff --git a/pkgs/by-name/ll/ll/ll.sh b/pkgs/by-name/ll/ll/ll.sh
index 73328e3e..e012cffa 100755
--- a/pkgs/by-name/ll/ll/ll.sh
+++ b/pkgs/by-name/ll/ll/ll.sh
@@ -1,9 +1,20 @@
 #!/usr/bin/env dash
 
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 last_directory="$(mktemp)"
+cleanup() {
+    rm "$last_directory"
+}
+trap cleanup EXIT
 
 command lf -last-dir-path="$last_directory" "$@"
 
@@ -15,5 +26,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..6e4ee336 100644
--- a/pkgs/by-name/ll/ll/package.nix
+++ b/pkgs/by-name/ll/ll/package.nix
@@ -1,9 +1,18 @@
-{sysLib}:
-sysLib.writeShellScript {
+# nixos-config - My current NixOS configuration
+#
+# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
+# SPDX-License-Identifier: GPL-3.0-or-later
+#
+# This file is part of my nixos-config.
+#
+# You should have received a copy of the License along with this program.
+# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{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;
+  # This is sourced in the shell
+  inheritPath = true;
+  bashOptions = [];
 }