aboutsummaryrefslogtreecommitdiffstats
path: root/home/lf
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2024-05-23 13:56:00 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-11-30 12:29:57 +0200
commit08297376a85a1719518507e54fca9de954d2376a (patch)
tree3b9c58304b40248533bbb2bb5b7bad2da9da1ff0 /home/lf
parent75c2af4aedd2ac5c2cfc74b346625fa4b265541d (diff)
downloadnixos-08297376a85a1719518507e54fca9de954d2376a.tar.zst
Agenix configuration
Diffstat (limited to 'home/lf')
-rw-r--r--home/lf/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/home/lf/default.nix b/home/lf/default.nix
new file mode 100644
index 0000000..dae7e7f
--- /dev/null
+++ b/home/lf/default.nix
@@ -0,0 +1,41 @@
+{ pkgs, ... }:
+{
+ programs.lf = {
+ enable = true;
+ commands = {
+ editor-open = ''$$EDITOR $f'';
+ };
+ settings = {
+ preview = true;
+ hidden = true;
+ drawbox = true;
+ icons = true;
+ ignorecase = true;
+ timefmt = "2006-01-02T15:04:05.999Z";
+ };
+ previewer.source = "/home/petri/.config/lf/pv.sh";
+ keybindings = {
+ ee = "editor-open";
+ };
+ };
+
+ xdg.configFile."/home/petri/.config/lf/icons".source = ./icons;
+ xdg.configFile."/home/petri/.config/lf/pv.sh" = {
+ executable = true;
+ text = ''
+ #!/bin/sh
+ case "$1" in
+ *.jpg*) timg -I "$1";;
+ *.png*) timg -I "$1";;
+ *.webp*) timg -I "$1";;
+ *.avif*) timg -I "$1";;
+ *.tar*) tar tf "$1";;
+ *.zip) unzip -l "$1";;
+ *.rar) unrar l "$1";;
+ *.7z) 7z l "$1";;
+ *.pdf) pdftotext "$1" -;;
+ *) pistol "$1";;
+ esac
+ '';
+ };
+}