From 29f9ba670fb266bcaa36e022f7ddeefa11c8c7bc Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Fri, 31 Jan 2025 23:40:31 -0500 Subject: [PATCH] adding yazi, refactor emacs package config, more --- dotfiles/dot_config/fish/functions/y.fish | 10 ++ dotfiles/dot_config/niri/config.kdl | 2 + flake.lock | 161 +++++++++++++++++----- flake.nix | 10 ++ home/home.nix | 101 ++++++++------ overlays/default.nix | 39 ------ 6 files changed, 208 insertions(+), 115 deletions(-) create mode 100644 dotfiles/dot_config/fish/functions/y.fish diff --git a/dotfiles/dot_config/fish/functions/y.fish b/dotfiles/dot_config/fish/functions/y.fish new file mode 100644 index 0000000..e0c26ff --- /dev/null +++ b/dotfiles/dot_config/fish/functions/y.fish @@ -0,0 +1,10 @@ +#!/usr/bin/env fish + +function y + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + builtin cd -- "$cwd" + end + rm -f -- "$tmp" +end diff --git a/dotfiles/dot_config/niri/config.kdl b/dotfiles/dot_config/niri/config.kdl index a80ce18..41a52b1 100644 --- a/dotfiles/dot_config/niri/config.kdl +++ b/dotfiles/dot_config/niri/config.kdl @@ -158,6 +158,8 @@ binds { Mod+B { spawn "firefox"; } //Mod+Space { spawn "fuzzel"; } Mod+Space { spawn "wezterm" "--config-file" "/home/emenel/.config/wezterm/launcher.lua" "start" "--class" "launcher" "--always-new-process" "sway-launcher-desktop"; } + Mod+Ctrl+V { spawn "wezterm" "--config-file" "/home/emenel/.config/wezterm/launcher.lua" "start" "--class" "launcher" "--always-new-process" "clipse"; } + Mod+Ctrl+F { spawn "wezterm" "--config-file" "/home/emenel/.config/wezterm/launcher.lua" "start" "--always-new-process" "yazi"; } Super+Shift+L { spawn "swaylock"; } // Example volume keys mappings for PipeWire & WirePlumber. diff --git a/flake.lock b/flake.lock index ccdf774..a07a4ea 100644 --- a/flake.lock +++ b/flake.lock @@ -3,17 +3,18 @@ "affinity-nix": { "inputs": { "elemental-wine-source": "elemental-wine-source", + "flake-compat": "flake-compat", "nixpkgs": [ "nixpkgs" ], "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1736488937, - "narHash": "sha256-RELMEuDFx9fKx5h3fWvpTR73tFAUZ0iILbjwHLVOs8w=", + "lastModified": 1738370996, + "narHash": "sha256-HFDE+kODQc3eYDaJGbinxyBwPr/02LJvd9Gyewbuxtc=", "owner": "mrshmllow", "repo": "affinity-nix", - "rev": "6fbbf794f2707531ae2de3c5ec20084fed49e13d", + "rev": "b77bfab85655365d516718d34ff93cd9308513b9", "type": "github" }, "original": { @@ -42,13 +43,12 @@ } }, "flake-compat": { - "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -89,6 +89,22 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -160,6 +176,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "freetype2": { "flake": false, "locked": { @@ -179,7 +213,7 @@ }, "ghostty": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", "zig": "zig" @@ -263,11 +297,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1738275749, - "narHash": "sha256-PM+cGduJ05EZ+YXulqAwUFjvfKpPmW080mcuN6R1POw=", + "lastModified": 1738378034, + "narHash": "sha256-mldSa2NhDlnjqeSSFTNnkXIDrCLltpJfhrHUMBBKEiY=", "owner": "nix-community", "repo": "home-manager", - "rev": "a8159195bfaef3c64df75d3b1e6a68d49d392be9", + "rev": "801ddd8693481866c2cfb1efd44ddbae778ea572", "type": "github" }, "original": { @@ -290,11 +324,11 @@ "uv2nix": "uv2nix" }, "locked": { - "lastModified": 1738047527, - "narHash": "sha256-LkiDTiWM+PupXSsw6SUs4PqIwgSAWZxnuPXAE6T7Z0Q=", + "lastModified": 1738374517, + "narHash": "sha256-SHQbbTJwU5cGbU+5Xws1ZGi36p44Rk4QggSr3cdSCj4=", "owner": "isd-project", "repo": "isd", - "rev": "369fd55c0e57079f5eca2291c013f74a5dcf3c10", + "rev": "81a03f70adf983390f0923cfa4b71d875c002f02", "type": "github" }, "original": { @@ -364,7 +398,7 @@ }, "nix-appimage": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs_3" }, @@ -577,7 +611,7 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "gitignore": "gitignore", "nixpkgs": "nixpkgs" }, @@ -611,11 +645,11 @@ ] }, "locked": { - "lastModified": 1735697508, - "narHash": "sha256-Acm4V8bHifkEZEGZHQ9eukRqPiSWXRgJyrjOB60FBg8=", + "lastModified": 1737338290, + "narHash": "sha256-gnXlfFEHA+/jMH7R+7y3JxrI3WfOjgBhzzJNuFW70UU=", "owner": "pyproject-nix", "repo": "build-system-pkgs", - "rev": "22d5f5d1814ede904def5a992c289343734672d4", + "rev": "e1487e5cefda0c7990bdd2e660bee20971680e45", "type": "github" }, "original": { @@ -632,11 +666,11 @@ ] }, "locked": { - "lastModified": 1735874123, - "narHash": "sha256-0uSnm3tyid97v6/m7SoBPgcfMya3nVqEM9Y2EpaTlp0=", + "lastModified": 1738204167, + "narHash": "sha256-J5M2sj3x4ocM93shScT/3Z4XWHZhwwW1NyQK+C+8Mys=", "owner": "pyproject-nix", "repo": "pyproject.nix", - "rev": "e14a14de0d0026e62d809bfa4cd92c4f9badb262", + "rev": "0d9f4b90cee1b5c5d6c142ef22de1e246e003ccc", "type": "github" }, "original": { @@ -660,7 +694,8 @@ "nixpkgs-unstable": "nixpkgs-unstable_2", "paperwm": "paperwm", "sops-nix": "sops-nix", - "wezterm": "wezterm" + "wezterm": "wezterm", + "yazi": "yazi" } }, "rust-overlay": { @@ -705,6 +740,27 @@ "type": "github" } }, + "rust-overlay_3": { + "inputs": { + "nixpkgs": [ + "yazi", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737080704, + "narHash": "sha256-n+J2h9GM9ZpFOQUmtZoCr1+DFF/iO5UlmLJeHIxbZGY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "f9953fe89f8b65401fc4d4a288940bc2cb072949", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, "sops-nix": { "inputs": { "nixpkgs": [ @@ -778,16 +834,16 @@ }, "systems_3": { "locked": { - "lastModified": 1680978846, - "narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "x86_64-linux", - "rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "x86_64-linux", + "repo": "default-linux", "type": "github" } }, @@ -821,6 +877,21 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "uv2nix": { "inputs": { "nixpkgs": [ @@ -833,11 +904,11 @@ ] }, "locked": { - "lastModified": 1735981341, - "narHash": "sha256-g7Wtbo4fsl0P0HFrg3AG+4j6T4Df8OBwfWtlaJQFlrc=", + "lastModified": 1738200085, + "narHash": "sha256-Lwb86tkHoeJdjYaAHYZPkUZJoWXNHb5IQjzDyd4Vxno=", "owner": "pyproject-nix", "repo": "uv2nix", - "rev": "9d314f9c9ab531791a63a6673b1120039dea1229", + "rev": "fd41fdec2fed599ba884bc2706c2263f01e2183c", "type": "github" }, "original": { @@ -860,11 +931,11 @@ }, "locked": { "dir": "nix", - "lastModified": 1737758457, - "narHash": "sha256-Z50/JcMQI2R9ttEd20gXEhuAXvAI0yp3bM7j6/Xoi+A=", + "lastModified": 1738379806, + "narHash": "sha256-3dkZt53Lr90wQOCPlDHAZn5t0G6n56t+JXW66+vviTE=", "owner": "wez", "repo": "wezterm", - "rev": "4bf0007cefff7f1ad139d89b54f074d5ad7d2184", + "rev": "b28bbbc4c8345197e433590c9ce50a7bf3ea5bc7", "type": "github" }, "original": { @@ -874,6 +945,28 @@ "type": "github" } }, + "yazi": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay_3" + }, + "locked": { + "lastModified": 1738314122, + "narHash": "sha256-lyA97h4cKYgX/RX2IDw1J3XWCj9rC4v2yW70nEX2wYo=", + "owner": "sxyazi", + "repo": "yazi", + "rev": "c41f2e21e039c068d4ae1d286f2a8a9eef182895", + "type": "github" + }, + "original": { + "owner": "sxyazi", + "repo": "yazi", + "type": "github" + } + }, "zig": { "inputs": { "flake-compat": [ diff --git a/flake.nix b/flake.nix index 532c9cf..3e0376b 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,16 @@ nix-flatpak.url = "github:gmodena/nix-flatpak"; # unstable branch + # emacs-overlay = { + # url = "github:nix-community/emacs-overlay"; + # inputs.nixpkgs.follows = "nixpkgs"; + # }; + + yazi = { + url = "github:sxyazi/yazi"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # kmonad = { # url = "git+https://github.com/kmonad/kmonad?submodules=1&dir=nix"; # inputs.nixpkgs.follows = "nixpkgs"; diff --git a/home/home.nix b/home/home.nix index db5bb91..1322b69 100644 --- a/home/home.nix +++ b/home/home.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, inputs, outputs, ... }: +{ config, pkgs, inputs, outputs, ... }: { nixpkgs = { @@ -6,6 +6,10 @@ outputs.overlays.additions outputs.overlays.modifications outputs.overlays.unstable-packages + (import (builtins.fetchTarball { + url = "https://github.com/nix-community/emacs-overlay/archive/master.tar.gz"; + sha256 = "0cfz3178ija6s37pa5rdfmqpcqj38gchn1y9q4iln2jrqh8v600i"; + })) ]; config = { @@ -86,9 +90,7 @@ # SDL2.dev protonplus ispell - aspell - aspellDicts.en - aspellDicts.en-computers + (aspellWithDicts (dicts: with dicts; [ en en-computers en-science es fr ])) texlive.combined.scheme-full appimage-run libappimage @@ -238,7 +240,7 @@ vorta stirling-pdf trash-cli - + ripdrag wineWowPackages.stagingFull winetricks @@ -319,7 +321,6 @@ alsa-tools clapper ardour - parinfer-rust-emacs dockfmt impala unstable.playerctl @@ -474,7 +475,18 @@ yazi = { enable = true; enableFishIntegration = true; - package = pkgs.unstable.yazi; + package = inputs.yazi.packages.x86_64-linux.default; + keymap = { + manager.prepend_keymap = [ + { + on = ""; + run = ''shell 'ripdrag "$@" -x 2>/dev/null &' --confirm''; + } + ]; + }; + settings = { + + }; }; fish = { enable = true; @@ -499,6 +511,9 @@ } ]; }; + zoxide = { + enable = true; + }; starship = { enable = true; }; @@ -507,29 +522,24 @@ msmtp.enable = true; emacs = { enable = true; - package = (pkgs.emacs29-pgtk.override { - withGTK3 = true; - # withPGTK = true; - withXwidgets = true; - withNativeCompilation = true; - withTreeSitter = true; - withImageMagick = true; - }); - extraPackages = epkgs: [ - epkgs.mu4e - epkgs.vterm - epkgs.sly - epkgs.sly-quicklisp - epkgs.geiser-racket - epkgs.editorconfig - epkgs.shfmt - epkgs.nixpkgs-fmt - epkgs.nixfmt - epkgs.parinfer-rust-mode - epkgs.tree-sitter-langs - # epkgs.gpastel - epkgs.pdf-tools - ]; + package = ((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages ( + epkgs: [ + epkgs.vterm + epkgs.mu4e + epkgs.sly + epkgs.sly-quicklisp + epkgs.geiser-racket + epkgs.editorconfig + epkgs.shfmt + epkgs.nixpkgs-fmt + epkgs.nixfmt + epkgs.parinfer-rust-mode + epkgs.tree-sitter-langs + epkgs.treesit-grammars.with-all-grammars + epkgs.pretty-sha-path + epkgs.pdf-tools + ] + )); }; ripgrep = { enable = true; @@ -609,10 +619,7 @@ swaylock = { enable = true; settings = { - font-size = 24; - indicator-idle-visible = true; - indicator-radius = 200; - color="1e1e1e"; + color="000000"; bs-hl-color="f5e0dc"; caps-lock-bs-hl-color="f5e0dc"; caps-lock-key-hl-color="a6e3a1"; @@ -738,14 +745,24 @@ emacs = { enable = true; defaultEditor = true; - package = (pkgs.emacs29-pgtk.override { - withGTK3 = true; - # withPGTK = true; - withXwidgets = true; - withNativeCompilation = true; - withTreeSitter = true; - withImageMagick = true; - }); + package = ((pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages ( + epkgs: [ + epkgs.vterm + epkgs.mu4e + epkgs.sly + epkgs.sly-quicklisp + epkgs.geiser-racket + epkgs.editorconfig + epkgs.shfmt + epkgs.nixpkgs-fmt + epkgs.nixfmt + epkgs.parinfer-rust-mode + epkgs.tree-sitter-langs + epkgs.treesit-grammars.with-all-grammars + epkgs.pretty-sha-path + epkgs.pdf-tools + ] + )); socketActivation.enable = true; client = { enable = true; diff --git a/overlays/default.nix b/overlays/default.nix index 984d91f..438efe7 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -43,45 +43,6 @@ rev = "5e677b178be7da08fb72d7cd0791bf68a129fcc5"; }; }); - - python312 = prev.python312.override { - packageOverrides = pyself: pysuper: { - openrazer = pysuper.openrazer.overrideAttrs (_: { - src = prev.fetchFromGitHub { - owner = "openrazer"; - repo = "openrazer"; - hash = "sha256-GqmFpVNuPRNM95pJsihsk/d3s61t4Lw+qaukKip9BAM="; - rev = "5e677b178be7da08fb72d7cd0791bf68a129fcc5"; - }; - }); - }; - }; - - python311 = prev.python311.override { - packageOverrides = pyself: pysuper: { - openrazer = pysuper.openrazer.overrideAttrs (_: { - src = prev.fetchFromGitHub { - version = "latest"; - owner = "openrazer"; - repo = "openrazer"; - hash = "sha256-GqmFpVNuPRNM95pJsihsk/d3s61t4Lw+qaukKip9BAM="; - rev = "5e677b178be7da08fb72d7cd0791bf68a129fcc5"; - }; - }); - }; - }; - - linuxPackages_6_12 = prev.linuxPackages_6_12.extend (lpf: lpp: { - openrazer = lpp.openrazer.overrideAttrs (_: { - src = prev.fetchFromGitHub { - owner = "openrazer"; - repo = "openrazer"; - version = "latest"; - hash = "sha256-GqmFpVNuPRNM95pJsihsk/d3s61t4Lw+qaukKip9BAM="; - rev = "5e677b178be7da08fb72d7cd0791bf68a129fcc5"; - }; - }); - }); }; # When applied, the unstable nixpkgs set (declared in the flake inputs) will