aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/co
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/co')
-rwxr-xr-xpkgs/by-name/co/con2pdf/con2pdf.sh25
-rw-r--r--pkgs/by-name/co/con2pdf/package.nix26
2 files changed, 30 insertions, 21 deletions
diff --git a/pkgs/by-name/co/con2pdf/con2pdf.sh b/pkgs/by-name/co/con2pdf/con2pdf.sh
index 27c9d092..ebe35ad3 100755
--- a/pkgs/by-name/co/con2pdf/con2pdf.sh
+++ b/pkgs/by-name/co/con2pdf/con2pdf.sh
@@ -1,19 +1,18 @@
#! /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>.
-# needed for help() and version
-# shellcheck disable=2034
-AUTHORS="Soispha"
-# shellcheck disable=2034
-YEARS="2023"
-# shellcheck disable=2034
-VERSION="1.0.0"
+# TODO(@bpeetz): This should probably be rewritten in rust. <2025-04-14>
-# NAME is from the wrapper
-# shellcheck disable=SC2269
-NAME="$NAME"
+NAME="con2pdf"
help() {
cat <<EOF
Scan images and turn them into a pdf.
@@ -52,7 +51,7 @@ ARGUMENTS:
NUM | *([0-9]) := 0 | 1 | 2 | 3 | 4
Possible numbers of pages, can be more than 4
- DEVICE := [[$(cat %DEVICE_FUNCTION)]]
+ DEVICE := [[$(cat "$DEVICE_FUNCTION")]]
Possible scanner names
METHOD := ADF | Flatbed
diff --git a/pkgs/by-name/co/con2pdf/package.nix b/pkgs/by-name/co/con2pdf/package.nix
index 8eb994fd..11d45ab5 100644
--- a/pkgs/by-name/co/con2pdf/package.nix
+++ b/pkgs/by-name/co/con2pdf/package.nix
@@ -1,24 +1,34 @@
+# 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>.
{
- 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