diff options
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/default.nix | 11 | ||||
-rw-r--r-- | modules/by-name/lf/lf/ctpv/prev/application/x-pem-file/pem.sh | 8 |
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 |