From 359e58f46942833b9b65d33769b2fc16eecee425 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Sun, 29 Jun 2025 22:23:40 -0400 Subject: [PATCH] yazi cleanup, forget about termfilechooser it is a rabbit hole --- flake.lock | 101 ---------------------- flake.nix | 3 - homes/emenel/default.nix | 5 -- hosts/eddie/configuration.nix | 5 -- modules/home/desktop.nix | 32 +------ modules/home/file-chooser/config | 5 -- modules/home/file-chooser/yazi-wrapper.sh | 29 ------- modules/home/shell-conf.nix | 3 + modules/home/yazi.nix | 43 ++++----- 9 files changed, 20 insertions(+), 206 deletions(-) delete mode 100644 modules/home/file-chooser/config delete mode 100755 modules/home/file-chooser/yazi-wrapper.sh diff --git a/flake.lock b/flake.lock index 4e4b8b0..ae0d5e4 100644 --- a/flake.lock +++ b/flake.lock @@ -261,24 +261,6 @@ "type": "github" } }, - "flake-parts_4": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib_4" - }, - "locked": { - "lastModified": 1722555600, - "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -841,18 +823,6 @@ "type": "github" } }, - "nixpkgs-lib_4": { - "locked": { - "lastModified": 1722555339, - "narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" - } - }, "nixpkgs-stable": { "locked": { "lastModified": 1751048012, @@ -901,22 +871,6 @@ "type": "github" } }, - "nixpkgs_10": { - "locked": { - "lastModified": 1720957393, - "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1735834308, @@ -1029,22 +983,6 @@ "type": "github" } }, - "nixpkgs_9": { - "locked": { - "lastModified": 1723362943, - "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "a58bc8ad779655e790115244571758e8de055e3d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "pyproject-build-systems": { "inputs": { "nixpkgs": [ @@ -1116,7 +1054,6 @@ "sops-nix": "sops-nix", "waybar": "waybar", "wezterm": "wezterm", - "xdg-desktop-portal-termfilepickers": "xdg-desktop-portal-termfilepickers", "xwayland-satellite": "xwayland-satellite", "yazi": "yazi", "zen-browser": "zen-browser" @@ -1355,24 +1292,6 @@ "type": "github" } }, - "treefmt-nix_3": { - "inputs": { - "nixpkgs": "nixpkgs_10" - }, - "locked": { - "lastModified": 1723454642, - "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "349de7bc435bdff37785c2466f054ed1766173be", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, "uv2nix": { "inputs": { "nixpkgs": [ @@ -1480,26 +1399,6 @@ "type": "github" } }, - "xdg-desktop-portal-termfilepickers": { - "inputs": { - "flake-parts": "flake-parts_4", - "nixpkgs": "nixpkgs_9", - "treefmt-nix": "treefmt-nix_3" - }, - "locked": { - "lastModified": 1750511941, - "narHash": "sha256-QB7TwZR31368HdQb4C9/s6ujiDtihwEbesTxKmz3Pbg=", - "owner": "guekka", - "repo": "xdg-desktop-portal-termfilepickers", - "rev": "1fe0479476465cc9061a8c7810a489e63ddc7fd7", - "type": "github" - }, - "original": { - "owner": "guekka", - "repo": "xdg-desktop-portal-termfilepickers", - "type": "github" - } - }, "xwayland-satellite": { "inputs": { "flake-utils": "flake-utils_3", diff --git a/flake.nix b/flake.nix index 93e47f0..d2816c0 100644 --- a/flake.nix +++ b/flake.nix @@ -73,8 +73,6 @@ url = "github:wez/wezterm?dir=nix"; }; - xdg-desktop-portal-termfilepickers.url = "github:guekka/xdg-desktop-portal-termfilepickers"; - sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -139,7 +137,6 @@ baseHomeModules = [ inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.sops-nix.homeManagerModules.sops - inputs.xdg-desktop-portal-termfilepickers.homeManagerModules.default ]; baseHomeManager = { diff --git a/homes/emenel/default.nix b/homes/emenel/default.nix index 9c2c622..4436f60 100644 --- a/homes/emenel/default.nix +++ b/homes/emenel/default.nix @@ -151,11 +151,6 @@ in "L /home/emenel/Documents - - - - /home/emenel/documents" ]; - xdg.configFile."xdg-desktop-portal-termfilechooser" = { - source = ../../modules/home/file-chooser; - recursive = true; - }; - home = { file = { ".signature".source = ./dotfiles/dot_signature; diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index a433e06..1db880e 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -43,10 +43,6 @@ }); }) - (final: prev: { - xdg-desktop-portal-termfilepickers = inputs.xdg-desktop-portal-termfilepickers.packages.${pkgs.system}.default; - }) - (final: prev: { manifold = prev.manifold.overrideAttrs (old: { cmakeFlags = [ @@ -326,7 +322,6 @@ pkgs.xdg-desktop-portal pkgs.xdg-desktop-portal-wlr pkgs.gnome-keyring - pkgs.xdg-desktop-portal-termfilepickers ]; }; diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix index ca5c91a..a57afdb 100644 --- a/modules/home/desktop.nix +++ b/modules/home/desktop.nix @@ -211,14 +211,6 @@ }; services = { - xdg-desktop-portal-termfilepickers = { - enable = true; - package = pkgs.xdg-desktop-portal-termfilepickers; - desktopEnvironments = [ "common" "niri" ]; - config = { - terminal_command = lib.getExe pkgs.wezterm; - }; - }; flatpak = { enable = true; packages = [ @@ -256,25 +248,6 @@ # xdg.configFile."wpaperd/config.toml".source = ../../homes/emenel/dotfiles/dot_config/wpaperd/config.toml; home.file.".local/wallpapers".source = ../../assets/wallpapers; - # xdg.mime = { - # enable = true; - # }; - - # xdg.mimeApps = { - # enable = true; - # defaultApplications = { - # "application/pdf" = [ "zen-twilight.desktop" ]; - # }; - # associations = { - # added = { - # "application/pdf" = [ "zen-twilight.desktop" ]; - # }; - # removed = { - # "application/pdf" = [ "chromium-browser.desktop" ]; - # }; - # }; - # }; - xdg.portal = { enable = true; configPackages = [ pkgs.niri-unstable ]; @@ -284,12 +257,9 @@ xdg-desktop-portal xdg-desktop-portal-wlr gnome-keyring - xdg-desktop-portal-termfilepickers ]; }; - # home.sessionVariables.TERMCMD = "wezterm --class=file_chooser"; - xdg.desktopEntries = { rmpc = { name = "rmpc (music player)"; @@ -329,5 +299,5 @@ }; xdg.configFile."halloy/config.toml".source = ../../homes/emenel/dotfiles/dot_config/halloy/config.toml; - # xdg.configFile."nyxt/config.lisp".source = ../../homes/emenel/dotfiles/dot_config/nyxt/config.lisp; + xdg.configFile."nyxt/config.lisp".source = ../../homes/emenel/dotfiles/dot_config/nyxt/config.lisp; } diff --git a/modules/home/file-chooser/config b/modules/home/file-chooser/config deleted file mode 100644 index adf68a5..0000000 --- a/modules/home/file-chooser/config +++ /dev/null @@ -1,5 +0,0 @@ -### $XDG_CONFIG_HOME/xdg-desktop-portal-termfilechooser/config ### - -[filechooser] -cmd=$HOME/.config/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh -default_dir=$HOME diff --git a/modules/home/file-chooser/yazi-wrapper.sh b/modules/home/file-chooser/yazi-wrapper.sh deleted file mode 100755 index ee102cb..0000000 --- a/modules/home/file-chooser/yazi-wrapper.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env sh - -set -ex - -multiple="$1" -directory="$2" -save="$3" -path="$4" -out="$5" -cmd="yazi" -termcmd="${TERMCMD:-$HOME/.local/bin/wezlauncher}" - -if [ "$save" = "1" ]; then - set -- --chooser-file="$out" "$path" -elif [ "$directory" = "1" ]; then - set -- --chooser-file="$out" --cwd-file="$out" "$path" -elif [ "$multiple" = "1" ]; then - set -- --chooser-file="$out" "$path" -else - set -- --chooser-file="$out" "$path" -fi - -command="$termcmd $cmd" -for arg in "$@"; do - escaped=$(printf "%s" "$arg" | sed 's/"/\\"/g') - command="$command \"$escaped\"" -done - -sh -c "$command" diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index 1453c5d..2b59cf5 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -106,6 +106,9 @@ }; }; }; + nushell = { + enable = true; + }; fish = { enable = true; shellAliases = { diff --git a/modules/home/yazi.nix b/modules/home/yazi.nix index 9096bbb..0b736d1 100644 --- a/modules/home/yazi.nix +++ b/modules/home/yazi.nix @@ -154,15 +154,6 @@ linemode = "time_and_size"; show_symlink = true; }; - opener = { - edit = [ - { run = "emacsclient -r \"$@\""; desc = "emacsclient"; orphan = true; block = false; } - { run = "nano \"$@\""; desc = "nano"; orphan = false; block = true; } - ]; - extract = [ - { run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; } - ]; - }; open = { prepend_rules = [ { name = "*.zip"; use = "extract"; } @@ -184,12 +175,12 @@ prepend_previewers = [ { mime = "audio/*"; run = "exifaudio"; } - # { name = "*.csv"; run = "rich-preview"; } - # { name = "*.md"; run = "rich-preview" ; } - # { name = "*.rst"; run = "rich-preview"; } - # { name = "*.ipynb"; run = "rich-preview"; } - # { name = "*.json"; run = "rich-preview"; } - # { name = "*.org"; run = "rich-preview"; } + { name = "*.csv"; run = "rich-preview"; } + { name = "*.md"; run = "rich-preview" ; } + { name = "*.rst"; run = "rich-preview"; } + { name = "*.ipynb"; run = "rich-preview"; } + { name = "*.json"; run = "rich-preview"; } + { name = "*.org"; run = "rich-preview"; } # Office Documents { mime = "application/openxmlformats-officedocument.*"; run = "office"; } @@ -221,16 +212,16 @@ # run = "mime-ext"; # prio = "high"; # } - # { - # id = "git"; - # name = "*"; - # run = "git"; - # } - # { - # id = "git"; - # name = "*/"; - # run = "git"; - # } + { + id = "git"; + name = "*"; + run = "git"; + } + { + id = "git"; + name = "*/"; + run = "git"; + } ]; }; tasks = { @@ -242,6 +233,4 @@ xdg.configFile."yazi/theme.toml".source = ./yazi/theme.toml; xdg.configFile."yazi/flavors".source = ./yazi/flavors; - # xdg.configFile."xdg-desktop-portal-termfilechooser/config".source = ./file-chooser/config; - # xdg.configFile."xdg-desktop-portal-termfilechooser/yazi-wrapper.sh".source = ./file-chooser/yazi-wrapper.sh; }