about summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-04 18:52:50 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-04 18:52:50 +0200
commit2a6d4e1b8fb33d86e0a73638e437b59b019c87b6 (patch)
tree058cccf4d9b005645f7d7a9a224f770747c30136 /modules
parentstyle(treewide): Format (diff)
downloadnixos-config-2a6d4e1b8fb33d86e0a73638e437b59b019c87b6.zip
feat(modules/lf/ctpv/application/x-pem-file): Include previewer
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix11
-rw-r--r--modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh8
2 files changed, 19 insertions, 0 deletions
diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix
new file mode 100644
index 00000000..a6a32808
--- /dev/null
+++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix
@@ -0,0 +1,11 @@
+{pkgs, ...}: {
+  soispha.programs.lf.ctpv.previewers = {
+    pem = {
+      previewer = ./pem.sh;
+      matches.mime = ["application/x-pem-file"];
+      dependencies = [
+        pkgs.openssl
+      ];
+    };
+  };
+}
diff --git a/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh
new file mode 100644
index 00000000..76ee3002
--- /dev/null
+++ b/modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh
@@ -0,0 +1,8 @@
+#! /usr/bin/env dash
+
+# shellcheck disable=SC2269
+f="$f"
+# shellcheck disable=SC2269
+cache_f="$cache_f"
+
+openssl x509 -in "$f" -text -noout