diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-04 18:52:50 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-04 18:52:50 +0200 |
commit | 2a6d4e1b8fb33d86e0a73638e437b59b019c87b6 (patch) | |
tree | 058cccf4d9b005645f7d7a9a224f770747c30136 | |
parent | style(treewide): Format (diff) | |
download | nixos-config-2a6d4e1b8fb33d86e0a73638e437b59b019c87b6.zip |
feat(modules/lf/ctpv/application/x-pem-file): Include previewer
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 |