aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/co
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-14 11:46:34 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-14 11:46:34 +0200
commit22d7a517c59c06579cd69ae90a87b1374d5ac73f (patch)
tree0f110d7055418925407b4a3573b0304a86b5977b /pkgs/by-name/co
parentpkgs/brightness: Migrate to `writeShellApplication` (diff)
downloadnixos-config-22d7a517c59c06579cd69ae90a87b1374d5ac73f.zip
pkgs/con2pdf: Migrate to `writeShellApplication`
Diffstat (limited to 'pkgs/by-name/co')
-rwxr-xr-xpkgs/by-name/co/con2pdf/con2pdf.sh15
-rw-r--r--pkgs/by-name/co/con2pdf/package.nix17
2 files changed, 11 insertions, 21 deletions
diff --git a/pkgs/by-name/co/con2pdf/con2pdf.sh b/pkgs/by-name/co/con2pdf/con2pdf.sh
index 27c9d092..e5d8ce37 100755
--- a/pkgs/by-name/co/con2pdf/con2pdf.sh
+++ b/pkgs/by-name/co/con2pdf/con2pdf.sh
@@ -1,19 +1,8 @@
#! /usr/bin/env dash
-# shellcheck source=/dev/null
-SHELL_LIBRARY_VERSION="2.1.2" . %SHELL_LIBRARY_PATH
+# TODO(@bpeetz): This should probably be rewritten in rust. <2025-04-14>
-# needed for help() and version
-# shellcheck disable=2034
-AUTHORS="Soispha"
-# shellcheck disable=2034
-YEARS="2023"
-# shellcheck disable=2034
-VERSION="1.0.0"
-
-# NAME is from the wrapper
-# shellcheck disable=SC2269
-NAME="$NAME"
+NAME="con2pdf"
help() {
cat <<EOF
Scan images and turn them into a pdf.
diff --git a/pkgs/by-name/co/con2pdf/package.nix b/pkgs/by-name/co/con2pdf/package.nix
index 8eb994fd..df24872c 100644
--- a/pkgs/by-name/co/con2pdf/package.nix
+++ b/pkgs/by-name/co/con2pdf/package.nix
@@ -1,24 +1,25 @@
{
- sysLib,
+ writeShellApplication,
writeText,
- # dependencies
+ # Dependencies
sane-backends,
imagemagick,
coreutils,
fd,
}:
-sysLib.writeShellScript {
+writeShellApplication {
name = "con2pdf";
- src = ./con2pdf.sh;
- generateCompletions = true;
- keepPath = false;
- dependencies = [
+ text = builtins.readFile ./con2pdf.sh;
+ inheritPath = false;
+
+ runtimeInputs = [
sane-backends
imagemagick
coreutils
fd
];
- replacementStrings = {
+
+ runtimeEnv = {
DEVICE_FUNCTION =
# This is here, because escaping the whole function, to use it in the shell script
# directly just isn't possible