about summary refs log tree commit diff stats
path: root/pkgs/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name')
-rwxr-xr-xpkgs/by-name/lo/lock/lock.sh13
-rw-r--r--pkgs/by-name/lo/lock/package.nix10
2 files changed, 9 insertions, 14 deletions
diff --git a/pkgs/by-name/lo/lock/lock.sh b/pkgs/by-name/lo/lock/lock.sh
index 3101ef9a..4c5e1c01 100755
--- a/pkgs/by-name/lo/lock/lock.sh
+++ b/pkgs/by-name/lo/lock/lock.sh
@@ -1,18 +1,15 @@
-#!/usr/bin/env dash
-
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
+# shellcheck shell=bash
 
 context="$(task _get rc.context)"
-[ "$context" ] && task context none
+[ -n "$context" ] && task context none
 
 # We have ensured that only one task is active
 active="$(task +ACTIVE _ids)"
-[ "$active" ] && task stop "$active"
+[ -n "$active" ] && task stop "$active"
 
 swaylock
 
-[ "$active" ] && task start "$active"
+[ -n "$active" ] && task start "$active"
 
-[ "$context" ] && task context "$context"
+[ -n "$context" ] && task context "$context"
 # vim: ft=sh
diff --git a/pkgs/by-name/lo/lock/package.nix b/pkgs/by-name/lo/lock/package.nix
index 0e6e38d0..84cbe3d1 100644
--- a/pkgs/by-name/lo/lock/package.nix
+++ b/pkgs/by-name/lo/lock/package.nix
@@ -1,14 +1,12 @@
 {
-  sysLib,
+  writeShellApplication,
   taskwarrior,
   swaylock,
 }:
-sysLib.writeShellScript {
+writeShellApplication {
   name = "lock";
-  src = ./lock.sh;
-  generateCompletions = false;
-  keepPath = false;
-  dependencies = [
+  text = builtins.readFile ./lock.sh;
+  runtimeInputs = [
     taskwarrior
     swaylock
   ];