From ddb92ea0c576b48fcca1e4d4e15fe5f9db2e95f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Wed, 28 May 2025 11:27:06 +0200 Subject: [PATCH] updates --- flake.lock | 511 +++++++++++++++++++------------------- flake.nix | 68 ++--- hosts/kili/home.nix | 25 ++ programs/fish/default.nix | 62 +++-- programs/jj/default.nix | 95 ++++++- programs/kanata/cfg.kbd | 4 +- programs/nvim/config.lua | 136 ++++------ programs/nvim/default.nix | 70 +----- programs/nvim/keys.nix | 103 ++++++++ programs/nvim/options.nix | 36 ++- programs/nvim/plugins.nix | 192 ++++++++++---- programs/tmux/default.nix | 259 ++++++++++--------- 12 files changed, 918 insertions(+), 643 deletions(-) create mode 100644 programs/nvim/keys.nix diff --git a/flake.lock b/flake.lock index 845d9df..02e599f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,20 +3,20 @@ "agenix": { "inputs": { "darwin": "darwin", - "home-manager": "home-manager_4", + "home-manager": "home-manager_3", "nixpkgs": [ "p1n3appl3", "ragenix", "nixpkgs" ], - "systems": "systems_7" + "systems": "systems_9" }, "locked": { - "lastModified": 1723293904, - "narHash": "sha256-b+uqzj+Wa6xgMS9aNbX4I+sXeb5biPDi39VgvSFqFvU=", + "lastModified": 1736955230, + "narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=", "owner": "ryantm", "repo": "agenix", - "rev": "f6291c5935fdc4e0bef208cfc0dcab7e3f7a1c41", + "rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c", "type": "github" }, "original": { @@ -67,11 +67,11 @@ ] }, "locked": { - "lastModified": 1737579274, - "narHash": "sha256-8kBIYfn8TI9jbffhDNS12SdbQHb9ITXflwcgIJBeGqw=", + "lastModified": 1748080874, + "narHash": "sha256-sUebEzAkrY8Aq5G0GHFyRddmRNGP/a2iTtV7ISNvi/c=", "owner": "catppuccin", "repo": "nix", - "rev": "06f0ea19334bcc8112e6d671fd53e61f9e3ad63a", + "rev": "0ba11b12be81f0849a89ed17ab635164ea8f0112", "type": "github" }, "original": { @@ -80,13 +80,28 @@ "type": "github" } }, + "cl-nix-lite": { + "locked": { + "lastModified": 1728174978, + "narHash": "sha256-Grqqg+xuicANB85j0gNEXxi9SBKY7bzGeTuyi95eGcY=", + "owner": "hraban", + "repo": "cl-nix-lite", + "rev": "31cfe6275c341eb3120a99f4b1c8516c49a29d87", + "type": "github" + }, + "original": { + "owner": "hraban", + "repo": "cl-nix-lite", + "type": "github" + } + }, "crane": { "locked": { - "lastModified": 1725409566, - "narHash": "sha256-PrtLmqhM6UtJP7v7IGyzjBFhbG4eOAHT6LPYOFmYfbk=", + "lastModified": 1741481578, + "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", "owner": "ipetkov", "repo": "crane", - "rev": "7e4586bad4e3f8f97a9271def747cf58c4b68f3c", + "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", "type": "github" }, "original": { @@ -163,27 +178,6 @@ "type": "github" } }, - "devshell": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735644329, - "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=", - "owner": "numtide", - "repo": "devshell", - "rev": "f7795ede5b02664b57035b3b757876703e2c3eac", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "dumpasm": { "inputs": { "flake-utils": "flake-utils", @@ -204,17 +198,20 @@ } }, "flake-compat": { + "flake": false, "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "revCount": 69, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + "lastModified": 1730663653, + "narHash": "sha256-kFCUWettiFHDIqxCWWQ9qY8pVh+Lj+XL0Giyy/kdomg=", + "owner": "hraban", + "repo": "flake-compat", + "rev": "e5b16676185cb7548581c852f51ce7f3a49bba5e", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + "owner": "hraban", + "ref": "fixed-output", + "repo": "flake-compat", + "type": "github" } }, "flake-parts": { @@ -225,11 +222,11 @@ ] }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -293,6 +290,21 @@ } }, "flake-utils_4": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { "inputs": { "systems": "systems_4" }, @@ -310,9 +322,9 @@ "type": "github" } }, - "flake-utils_5": { + "flake-utils_6": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1731533236, @@ -328,27 +340,9 @@ "type": "github" } }, - "flake-utils_6": { - "inputs": { - "systems": "systems_8" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "flake-utils_7": { "inputs": { - "systems": "systems_9" + "systems": "systems_10" }, "locked": { "lastModified": 1710146030, @@ -364,51 +358,21 @@ "type": "github" } }, - "git-hooks": { + "flake-utils_8": { "inputs": { - "flake-compat": [ - "nixvim", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] + "systems": "systems_11" }, "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "nixvim", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, @@ -419,16 +383,15 @@ ] }, "locked": { - "lastModified": 1736373539, - "narHash": "sha256-dinzAqCjenWDxuy+MqUQq0I4zUSfaCvN9rzuCmgMZJY=", + "lastModified": 1749526396, + "narHash": "sha256-UL9F76abAk87llXOrcQRjhd5OaOclUd6MIltsqcUZmo=", "owner": "nix-community", "repo": "home-manager", - "rev": "bd65bc3cde04c16755955630b344bc9e35272c56", + "rev": "427c96044f11a5da50faf6adaf38c9fa47e6d044", "type": "github" }, "original": { "owner": "nix-community", - "ref": "release-24.11", "repo": "home-manager", "type": "github" } @@ -436,16 +399,16 @@ "home-manager_2": { "inputs": { "nixpkgs": [ - "nixvim", + "p1n3appl3", "nixpkgs" ] }, "locked": { - "lastModified": 1738878603, - "narHash": "sha256-fmhq8B3MvQLawLbMO+LWLcdC2ftLMmwSk+P29icJ3tE=", + "lastModified": 1748830238, + "narHash": "sha256-EB+LzYHK0D5aqxZiYoPeoZoOzSAs8eqBDxm3R+6wMKU=", "owner": "nix-community", "repo": "home-manager", - "rev": "433799271274c9f2ab520a49527ebfe2992dcfbd", + "rev": "c7fdb7e90bff1a51b79c1eed458fb39e6649a82a", "type": "github" }, "original": { @@ -455,27 +418,6 @@ } }, "home-manager_3": { - "inputs": { - "nixpkgs": [ - "p1n3appl3", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738789832, - "narHash": "sha256-HdlMPfObPu5y7oDfH/w3vvlU3UTQ/bQjSULChZARm5M=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "30ea6fed4e4b41693cebc2263373dd810de4de49", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "home-manager_4": { "inputs": { "nixpkgs": [ "p1n3appl3", @@ -498,7 +440,7 @@ "type": "github" } }, - "home-manager_5": { + "home-manager_4": { "inputs": { "nixpkgs": [ "rahul-config", @@ -550,16 +492,16 @@ ] }, "locked": { - "lastModified": 1729958008, - "narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=", + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", "owner": "NuschtOS", "repo": "ixx", - "rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", "type": "github" }, "original": { "owner": "NuschtOS", - "ref": "v0.0.6", + "ref": "v0.0.8", "repo": "ixx", "type": "github" } @@ -573,11 +515,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1739043245, - "narHash": "sha256-WmlACEj2OB7XpBYEyvUZiEcSoCXLtRVqJ2UYLBtICGw=", + "lastModified": 1749530384, + "narHash": "sha256-8tyNH+gXWVKuKIvaPxZTB3pfBanZLvdAKr5lhrf7KY0=", "owner": "martinvonz", "repo": "jj", - "rev": "07c63ed182bb1cbd9b52fe8e4f41638bdb5aafb6", + "rev": "82705600759deb825b53e4544ed270fcba419cca", "type": "github" }, "original": { @@ -589,11 +531,11 @@ "kitty-search": { "flake": false, "locked": { - "lastModified": 1675366825, - "narHash": "sha256-egisza7V5dWplRYHIYt4bEQdqXa4E7UhibyWJAup8as=", + "lastModified": 1749065041, + "narHash": "sha256-Xy4dH2fzEQmKfqhmotVDEszuTqoISONGNfC1yfcdevs=", "owner": "trygveaa", "repo": "kitty-kitten-search", - "rev": "0760138fad617c5e4159403cbfce8421ccdfe571", + "rev": "992c1f3d220dc3e1ae18a24b15fcaf47f4e61ff8", "type": "github" }, "original": { @@ -602,23 +544,52 @@ "type": "github" } }, + "mac-app-util": { + "inputs": { + "cl-nix-lite": "cl-nix-lite", + "flake-compat": "flake-compat", + "flake-utils": [ + "p1n3appl3", + "flake-utils" + ], + "nixpkgs": [ + "p1n3appl3", + "nixpkgs" + ], + "systems": "systems_7" + }, + "locked": { + "lastModified": 1742156590, + "narHash": "sha256-aTM/2CrNN5utdVEQGsOA+kl4UozgH7VPLBQL5OXtBrg=", + "owner": "hraban", + "repo": "mac-app-util", + "rev": "341ede93f290df7957047682482c298e47291b4d", + "type": "github" + }, + "original": { + "owner": "hraban", + "repo": "mac-app-util", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ - "nixvim", + "p1n3appl3", "nixpkgs" ] }, "locked": { - "lastModified": 1738743987, - "narHash": "sha256-O3bnAfsObto6l2tQOmQlrO6Z2kD6yKwOWfs7pA0CpOc=", - "owner": "lnl7", + "lastModified": 1748352827, + "narHash": "sha256-sNUUP6qxGkK9hXgJ+p362dtWLgnIWwOCmiq72LAWtYo=", + "owner": "LnL7", "repo": "nix-darwin", - "rev": "ae406c04577ff9a64087018c79b4fdc02468c87c", + "rev": "44a7d0e687a87b73facfe94fba78d323a6686a90", "type": "github" }, "original": { - "owner": "lnl7", + "owner": "LnL7", + "ref": "master", "repo": "nix-darwin", "type": "github" } @@ -631,11 +602,11 @@ ] }, "locked": { - "lastModified": 1738466368, - "narHash": "sha256-PZhUjtvQZOH3PO0EYdTpQvcqkgkq1NkP2A6w9SPHYsk=", + "lastModified": 1748751003, + "narHash": "sha256-i4GZdKAK97S0ZMU3w4fqgEJr0cVywzqjugt2qZPrScs=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "46a8f5fc9552b776bfc5c5c96ea3bede33f68f52", + "rev": "2860bee699248d828c2ed9097a1cd82c2f991b43", "type": "github" }, "original": { @@ -667,6 +638,25 @@ } }, "nixgl": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1713543440, + "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "owner": "nix-community", + "repo": "nixGL", + "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixGL", + "type": "github" + } + }, + "nixgl_2": { "inputs": { "flake-utils": [ "p1n3appl3", @@ -693,11 +683,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1738816619, - "narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=", + "lastModified": 1748634340, + "narHash": "sha256-pZH4bqbOd8S+si6UcfjHovWDiWKiIGRNRMpmRWaDIms=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "2eccff41bab80839b1d25b303b53d339fbb07087", + "rev": "daa628a725ab4948e0e2b795e8fb6f4c3e289a7a", "type": "github" }, "original": { @@ -740,11 +730,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1738702386, - "narHash": "sha256-nJj8f78AYAxl/zqLiFGXn5Im1qjFKU8yBPKoWEeZN5M=", + "lastModified": 1748421225, + "narHash": "sha256-XXILOc80tvlvEQgYpYFnze8MkQQmp3eQxFbTzb3m/R0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "030ba1976b7c0e1a67d9716b17308ccdab5b381e", + "rev": "78add7b7abb61689e34fc23070a8f55e1d26185b", "type": "github" }, "original": { @@ -756,27 +746,26 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1739101192, - "narHash": "sha256-KFt/4jHEm2sMe2febmnTYrq91G7IV4sVlXVNiPiU8k4=", - "owner": "NixOS", + "lastModified": 1660551188, + "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "a35866ed8d4e6512c64918324ba3af38219b67a9", + "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "release-24.11", + "owner": "nixos", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_3": { "locked": { - "lastModified": 1738680400, - "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "799ba5bffed04ced7067a91798353d360788b30d", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", "type": "github" }, "original": { @@ -787,6 +776,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1722062969, "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", @@ -802,7 +807,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1710377395, "narHash": "sha256-KMubsUWtVr7L55pXMBibBDBdmk3xrjbBPduc0E8z28c=", @@ -818,24 +823,19 @@ }, "nixvim": { "inputs": { - "devshell": "devshell", - "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "git-hooks": "git-hooks", - "home-manager": "home-manager_2", - "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], "nuschtosSearch": "nuschtosSearch", - "treefmt-nix": "treefmt-nix" + "systems": "systems_5" }, "locked": { - "lastModified": 1738966895, - "narHash": "sha256-OXOh35rTEnFSO4vj/SDMIlDvFPGW0ba1XhZkfx+AlL0=", + "lastModified": 1749496904, + "narHash": "sha256-eNDMzrcDBOprdJs7DpMOJfCEcxribxDJP2OjozSC3Wo=", "owner": "nix-community", "repo": "nixvim", - "rev": "e7f20a602f6e08a70045f36c531bc44ba1baed07", + "rev": "e0b3d8bc3a0ab5a7cc0792c7705e92f9c5c598f3", "type": "github" }, "original": { @@ -846,7 +846,7 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "ixx": "ixx", "nixpkgs": [ "nixvim", @@ -854,11 +854,11 @@ ] }, "locked": { - "lastModified": 1738508923, - "narHash": "sha256-4DaDrQDAIxlWhTjH6h/+xfG05jt3qDZrZE/7zDLQaS4=", + "lastModified": 1748298102, + "narHash": "sha256-PP11GVwUt7F4ZZi5A5+99isuq39C59CKc5u5yVisU/U=", "owner": "NuschtOS", "repo": "search", - "rev": "86e2038290859006e05ca7201425ea5b5de4aecb", + "rev": "f8a1c221afb8b4c642ed11ac5ee6746b0fe1d32f", "type": "github" }, "original": { @@ -876,11 +876,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1731441000, - "narHash": "sha256-P0u/UAS1OqKJfzbWMf1vDHKcld0LE2kEU04ENvCCk6k=", + "lastModified": 1744483413, + "narHash": "sha256-/Ty3KAon/NlSS3wFPGUSkSBlyt1Ao1dg5LvTFsgK4/U=", "owner": "p1n3appl3", "repo": "obs-gamepad", - "rev": "fe326f233c03cfb7f55938b3ad4baf61f1d9869e", + "rev": "6552453336d4c8c83e977268365ed6c2ffde764e", "type": "github" }, "original": { @@ -892,27 +892,28 @@ "p1n3appl3": { "inputs": { "catppuccin": "catppuccin", - "flake-utils": "flake-utils_5", - "home-manager": "home-manager_3", + "flake-utils": "flake-utils_6", + "home-manager": "home-manager_2", + "mac-app-util": "mac-app-util", + "nix-darwin": "nix-darwin", "nix-index-database": "nix-index-database", - "nixgl": "nixgl", + "nixgl": "nixgl_2", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "nixpkgs-stable": "nixpkgs-stable", "obs-gamepad": "obs-gamepad", "ragenix": "ragenix", "rahul-config": [ "rahul-config" ], - "slippi": "slippi", - "zed": "zed" + "slippi": "slippi" }, "locked": { - "lastModified": 1738892328, - "narHash": "sha256-XQp+iIdyq1Jp266Ij2QhwXtdryRG6Z72gp3utHLlwTg=", + "lastModified": 1749071656, + "narHash": "sha256-LaOapF5/WHh5QlhrY64j7ZCSe7Sdfx8qFB1d0dLxamY=", "owner": "p1n3appl3", "repo": "config", - "rev": "affc2d239f470b35ee15393d1d44ccfd06730d87", + "rev": "eb7780dfe956775c0ae9ea844fe9a01445283426", "type": "github" }, "original": { @@ -931,16 +932,16 @@ ], "nixpkgs": [ "p1n3appl3", - "nixpkgs" + "nixpkgs-stable" ], "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1726755133, - "narHash": "sha256-03XIEjHeZEjHXctsXYUB+ZLQmM0WuhR6qWQjwekFk/M=", + "lastModified": 1744897914, + "narHash": "sha256-GIVU92o2TZBnKQXTb76zpQbWR4zjU2rFqWKNIIpXnqA=", "owner": "yaxitech", "repo": "ragenix", - "rev": "687ee92114bce9c4724376cf6b21235abe880bfa", + "rev": "40f2e17ecaeab4d78ec323e96a04548c0aaa5223", "type": "github" }, "original": { @@ -984,12 +985,12 @@ "inputs": { "agenix": "agenix_2", "darwin": "darwin_2", - "flake-utils": "flake-utils_6", - "home-manager": "home-manager_5", + "flake-utils": "flake-utils_7", + "home-manager": "home-manager_4", "impermanence": "impermanence", "nix-index-database": "nix-index-database_2", "nixos-hardware": "nixos-hardware_2", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "ragenix": "ragenix_2" }, "locked": { @@ -1013,7 +1014,8 @@ "home-manager": "home-manager", "jujutsu": "jujutsu", "kitty-search": "kitty-search", - "nixpkgs": "nixpkgs_2", + "nixgl": "nixgl", + "nixpkgs": "nixpkgs_3", "nixvim": "nixvim", "p1n3appl3": "p1n3appl3", "rahul-config": "rahul-config", @@ -1028,11 +1030,11 @@ ] }, "locked": { - "lastModified": 1737685583, - "narHash": "sha256-p+NVABRpGi+pT+xxf9HcLcFVxG6L+vEEy+NwzB9T0f8=", + "lastModified": 1747967795, + "narHash": "sha256-76s4jDRbQzxRO+5y8ilMp5V30qVgY9R6n8U7aOap8ig=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "eb64cbcc8eee0fa87ebded92805280d2ec97415a", + "rev": "f1d5bfa8c692cacd798a3e1fb93d54c1b9ac701a", "type": "github" }, "original": { @@ -1050,11 +1052,11 @@ ] }, "locked": { - "lastModified": 1725675754, - "narHash": "sha256-hXW3csqePOcF2e/PYnpXj72KEYyNj2HzTrVNmS/F7Ug=", + "lastModified": 1741400194, + "narHash": "sha256-tEpgT+q5KlGjHSm8MnINgTPErEl8YDzX3Eps8PVc09g=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "8cc45e678e914a16c8e224c3237fb07cf21e5e54", + "rev": "16b6045a232fea0e9e4c69e55a6e269607dd8e3f", "type": "github" }, "original": { @@ -1105,11 +1107,11 @@ ] }, "locked": { - "lastModified": 1738254766, - "narHash": "sha256-HgwiOEieKj9F7JIPR5X9YoDBb2eOwainKZqAJM/3OWU=", + "lastModified": 1747878710, + "narHash": "sha256-uSRpAVZ7u0/6ixVFrW8MWZaMw58SJCZXUNbVV54OQ0w=", "owner": "lytedev", "repo": "slippi-nix", - "rev": "3b06734c76497732e4d347f376c085a4e5d7d17d", + "rev": "700c62cc18acbe3a4accdd73e11a3752e234fd6e", "type": "github" }, "original": { @@ -1133,6 +1135,36 @@ "type": "github" } }, + "systems_10": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_11": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -1210,16 +1242,16 @@ }, "systems_7": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347925, + "narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-darwin", + "rev": "2235d7e6cc29ae99878133c95e9fe5e157661ffb", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-darwin", "type": "github" } }, @@ -1255,8 +1287,8 @@ }, "t": { "inputs": { - "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_5" + "flake-utils": "flake-utils_8", + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1710410762, @@ -1272,37 +1304,16 @@ "type": "github" } }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738680491, - "narHash": "sha256-8X7tR3kFGkE7WEF5EXVkt4apgaN85oHZdoTGutCFs6I=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "64dbb922d51a42c0ced6a7668ca008dded61c483", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, "utils": { "inputs": { - "systems": "systems_6" + "systems": "systems_8" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -1310,22 +1321,6 @@ "repo": "flake-utils", "type": "github" } - }, - "zed": { - "flake": false, - "locked": { - "lastModified": 1738824383, - "narHash": "sha256-9HoLYYnYr0sd8KKc7gQSUUmkzomtoZA+bv1tU2zuEVc=", - "owner": "zed-industries", - "repo": "zed", - "rev": "10792ee0ad3b58c24f9977c903d2b8a84dfbdd15", - "type": "github" - }, - "original": { - "owner": "zed-industries", - "repo": "zed", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 6ee05fb..b3b8801 100644 --- a/flake.nix +++ b/flake.nix @@ -1,9 +1,11 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + # nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; home-manager = { - url = "github:nix-community/home-manager/release-24.11"; + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; @@ -30,18 +32,20 @@ inputs.rahul-config.follows = "rahul-config"; }; rahul-config.url = "github:jdonszelmann/nix-config"; + + nixgl.url = "github:nix-community/nixGL"; }; outputs = - { - home-manager, - nixpkgs, - flake-utils, - nixvim, - t, - dumpasm, - jujutsu, - ... + { home-manager + , nixpkgs + , flake-utils + , nixvim + , t + , dumpasm + , jujutsu + , nixgl + , ... }@inputs: let homeManagerModules = [ nixvim.homeManagerModules.nixvim ]; @@ -52,6 +56,7 @@ inherit system; config.allowUnfree = true; overlays = [ + nixgl.overlay (_: _: { custom = { t = t.packages.${system}.default; @@ -74,28 +79,29 @@ } ); in - flake-utils.lib.eachDefaultSystem (system: rec { - formatter = legacyPackages.nixfmt-classic; - legacyPackages = pkgsForSystem system; - pkgs = legacyPackages; - devShells.default = pkgs.mkShell { - buildInputs = with pkgs; [ - (pkgs.writeShellScriptBin "fast-repl" '' - source /etc/set-environment - nix repl --file "${./.}/repl.nix" $@ - '') + flake-utils.lib.eachDefaultSystem + (system: rec { + formatter = legacyPackages.nixfmt-classic; + legacyPackages = pkgsForSystem system; + pkgs = legacyPackages; + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + (pkgs.writeShellScriptBin "fast-repl" '' + source /etc/set-environment + nix repl --file "${./.}/repl.nix" $@ + '') - (pkgs.writeShellScriptBin "apply-home" '' - export NIX_BUILD_CORES=$(($(nproc) * 2)) - nix run .#home-manager -- switch --flake .#$@ -j $(nproc) --cores $(nproc) - '') + (pkgs.writeShellScriptBin "apply-home" '' + export NIX_BUILD_CORES=$(($(nproc) * 2)) + nix run .#home-manager -- switch --flake .#$@ -j $(nproc) --cores $(nproc) + '') - (pkgs.writeShellScriptBin "apply" '' - apply-home $(hostname -f) - '') - ]; - }; - }) + (pkgs.writeShellScriptBin "apply" '' + apply-home $(hostname -f) + '') + ]; + }; + }) // { homeConfigurations = { diff --git a/hosts/kili/home.nix b/hosts/kili/home.nix index 4797345..988026e 100644 --- a/hosts/kili/home.nix +++ b/hosts/kili/home.nix @@ -7,7 +7,11 @@ packages = with pkgs; [ p1n3appl3.tab + (pkgs.writeShellScriptBin "gg" '' + ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ${gg-jj}/bin/gg + '') ]; + }; imports = [ @@ -30,4 +34,25 @@ echo "#!/usr/bin/env bash\nexec /usr/bin/kitty" > $out/bin/kitty; ''; }; + + home.file = { + "dl".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.download}"; + "doc".source = config.lib.file.mkOutOfStoreSymlink "${config.xdg.userDirs.documents}"; + }; + + xdg = { + enable = true; + + configHome = "${config.home.homeDirectory}/.config"; + userDirs = { + enable = true; + documents = "${config.home.homeDirectory}/Documents"; + desktop = "${config.home.homeDirectory}/Documents"; + download = "${config.home.homeDirectory}/Downloads"; + music = "${config.home.homeDirectory}/Documents/personal/music"; + pictures = "${config.home.homeDirectory}/Documents/personal/pictures"; + }; + + mime.enable = true; + }; } diff --git a/programs/fish/default.nix b/programs/fish/default.nix index 3ba6e8d..3166199 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -1,8 +1,7 @@ -{ - config, - pkgs, - lib, - ... +{ config +, pkgs +, lib +, ... }: with builtins; with lib.attrsets; @@ -25,17 +24,30 @@ let "cb" = "${pkgs.wl-clipboard-rs}/bin/wl-copy"; "cat" = "${pkgs.bat}/bin/bat"; - "pull" = "${pkgs.git}/bin/git pull"; - "push" = "${pkgs.git}/bin/git push"; - "commit" = "${pkgs.git}/bin/git commit"; - "add" = "${pkgs.git}/bin/git add"; - "patch" = "${pkgs.git}/bin/git add -p"; - "amend" = "${pkgs.git}/bin/git commit --amend"; - "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; - "st" = "${pkgs.git}/bin/git status"; - "checkout" = "${pkgs.git}/bin/git checkout"; - "rebase" = "${pkgs.git}/bin/git rebase"; - "stash" = "${pkgs.git}/bin/git stash"; + # "pull" = "${pkgs.git}/bin/git pull"; + # "push" = "${pkgs.git}/bin/git push"; + # "commit" = "${pkgs.git}/bin/git commit"; + # "add" = "${pkgs.git}/bin/git add"; + # "patch" = "${pkgs.git}/bin/git add -p"; + # "amend" = "${pkgs.git}/bin/git commit --amend"; + # "log" = "${pkgs.git}/bin/git log --all --graph --decorate"; + # "st" = "${pkgs.git}/bin/git status"; + # "checkout" = "${pkgs.git}/bin/git checkout"; + # "rebase" = "${pkgs.git}/bin/git rebase"; + # "stash" = "${pkgs.git}/bin/git stash"; + + "edit" = "jj edit"; + "old" = "jj edit @-"; + "new" = "jj edit @+"; + "rebase" = "jj rebase"; + "pull" = "jj git fetch; jj catchup"; + "msg" = "jj describe -m"; + "branch" = "jj bookmark set"; + "stat" = "jj status"; + "push" = "jj git push"; + + "tidy" = "x test tidy --bless"; + "ui" = "x test tests/ui/"; "f" = "nautilus --no-desktop . &"; }; @@ -165,15 +177,15 @@ in ${config.programs.jujutsu.package}/bin/jj util completion fish | source - if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items - set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) - if test $tide_item_jj_idx - set tide_left_prompt_items \ - $tide_left_prompt_items[1..$tide_item_jj_idx] \ - jj \ - $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] - end - end + # if set -q tide_left_prompt_items; and not contains "jj" $tide_left_prompt_items + # set -l tide_item_jj_idx (contains -i "pwd" $tide_left_prompt_items) + # if test $tide_item_jj_idx + # set tide_left_prompt_items \ + # $tide_left_prompt_items[1..$tide_item_jj_idx] \ + # jj \ + # $tide_left_prompt_items[(math $tide_item_jj_idx + 1)..-1] + # end + # end function t cd "$(${pkgs.custom.t}/bin/t-rs $argv | tail -n 1)" diff --git a/programs/jj/default.nix b/programs/jj/default.nix index 988b6fb..98c899d 100644 --- a/programs/jj/default.nix +++ b/programs/jj/default.nix @@ -1,8 +1,8 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: { programs.jujutsu = { enable = true; - package = pkgs.custom.jujutsu; + # package = pkgs.custom.jujutsu; settings = { user = { @@ -11,9 +11,10 @@ }; ui = { + paginate = "never"; pager = "${pkgs.delta}/bin/delta"; # for delta - diff.format = "git"; + diff-formatter = ":git"; default-command = [ "log" @@ -32,10 +33,86 @@ # diff-editor = "${pkgs.meld}/bin/meld"; }; - revsets.log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"; + # core.fsmonitor = "${pkgs.watchman}/bin/watchman"; + core.fsmonitor = "watchman"; + core.watchman.register-snapshot-trigger = true; + + revsets.log = "@ | ancestors(tronk()..(visible_heads() & mine()), 2) | tronk()"; + # revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)"; + # revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)"; + + revset-aliases = { + "tronk()" = ''latest((present(main) | present(master)) & remote_bookmarks())''; + "my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")"; + "user(x)" = "author(x) | committer(x)"; + current = ''bookmarks() & my() & ~immutable()''; + "closest_bookmark(to)" = "heads(::to & bookmarks())"; + }; + + template-aliases = { + "format_timestamp(timestamp)" = "timestamp.ago()"; + }; + + aliases = { + tug = [ + "bookmark" + "move" + "--from" + "closest_bookmark(@-)" + "--to" + "@-" + ]; + catchup = [ + "rebase" + "-b" + "all:current" + "-d" + "tronk()" + "--skip-emptied" + ]; + }; + + templates = { + log_node = '' + label("node", + coalesce( + if(!self, label("elided", "~")), + if(current_working_copy, label("working_copy", "@")), + if(conflict, label("conflict", "×")), + if(immutable, label("immutable", "*")), + label("normal", "·") + ) + ) + ''; + log = '' + if(root, + format_root_commit(self), + label(if(current_working_copy, "working_copy"), + concat( + separate(" ", + format_short_change_id_with_hidden_and_divergent_info(self), + if(empty, label("empty", "(empty)")), + if(description, + description.first_line(), + label(if(empty, "empty"), description_placeholder), + ), + bookmarks, + tags, + working_copies, + if(git_head, label("git_head", "HEAD")), + if(conflict, label("conflict", "conflict")), + if(config("ui.show-cryptographic-signatures").as_boolean(), + format_short_cryptographic_signature(signature)), + ) ++ "\n", + ), + ) + ) + ''; + }; signing = { - sign-all = true; + # sign-all = true; + behavior = "own"; backend = "ssh"; key = "~/.ssh/id_ed25519.pub"; }; @@ -43,6 +120,14 @@ git = { push-bookmark-prefix = "jdonszelmann/"; private-commits = "description(glob:'wip:*')"; + write-change-id-header = true; + + fetch = [ + "upstream" + "origin" + ]; + push = "origin"; + auto-local-bookmark = true; }; }; }; diff --git a/programs/kanata/cfg.kbd b/programs/kanata/cfg.kbd index 1d5dd8b..16d416d 100644 --- a/programs/kanata/cfg.kbd +++ b/programs/kanata/cfg.kbd @@ -16,7 +16,7 @@ grv 1 2 3 4 5 6 7 8 9 0 - = bspc tab q w e r t y u i o p [ ] \ @cap a s d f g h j k l ; ' ret - @lst z x c v b n m , . / rsft + lsft z x c v b n m , . / rsft lctl lmet lalt spc ralt rctl ) @@ -25,7 +25,7 @@ grv 1 2 3 4 5 6 7 8 9 0 - = bspc tab q w e @replay t y u i o p @wup @wdown \ @cap a s d f g left down up right ; ' bspc - @lst z x C-c v bspc n @macro , . C-f rsft + lsft z x C-c v bspc n @macro , . C-f rsft lctl lmet lalt spc ralt rctl ) diff --git a/programs/nvim/config.lua b/programs/nvim/config.lua index cdf0b4d..0507bae 100644 --- a/programs/nvim/config.lua +++ b/programs/nvim/config.lua @@ -1,12 +1,6 @@ vim.o.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" -local otter = require'otter' -otter.setup{} -vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { - pattern = {"*.md"}, - callback = function() otter.activate({'python', 'rust', 'c', 'lua', 'bash' }, true, true, nil) end, -}) vim.filetype.add({ extension = { mdx = "markdown", @@ -14,57 +8,6 @@ vim.filetype.add({ }) -local cmp = require("cmp") -cmp.setup { - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - view = { - docs = { - auto_open = false - } - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [''] = cmp.mapping.confirm({ select = true }), - - [''] = function() - if cmp.visible_docs() then - cmp.close_docs() - else - cmp.open_docs() - end - end - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = "otter" }, - { name = 'path' }, - { name = 'vsnip' }, - { name = 'spell' }, - }, { - { name = 'buffer' }, - }), - comparators = { - -- compare.score_offset, -- not good at all - cmp.config.compare.locality, - cmp.config.compare.recently_used, - cmp.config.compare.score, - cmp.config.compare.offset, - cmp.config.compare.order, - }, -} - -- key mapping local keymap = vim.api.nvim_set_keymap local opts = { noremap = true, silent = true } @@ -194,47 +137,19 @@ vim.api.nvim_create_user_command('CloseBuffer', function (opts) end end, { desc = "Close Current Buffer", bang = true, }) -vim.keymap.set("ca", "W", "w") -vim.keymap.set("ca", "X", "x") -vim.keymap.set("ca", "Q", "q") +local function close_floating() + for _, win in ipairs(vim.api.nvim_list_wins()) do + local config = vim.api.nvim_win_get_config(win) + if config.relative ~= "" then + vim.api.nvim_win_close(win, false) + end + end +end -vim.keymap.set("ca", "q", "CloseBuffer") -vim.keymap.set("ca", "qw", "quit") - --- format on wq and x and replace X, W and Q with x, w and q --- vim.cmd [[cnoreabbrev w execute "Format sync" w]] --- vim.cmd [[cnoreabbrev x execute "Format sync" w CustomCloseBuffer ]] --- vim.cmd [[cabbrev W w]] --- vim.cmd [[cabbrev X execute "Format sync" x]] --- vim.cmd [[cabbrev Q CustomCloseBuffer]] --- vim.cmd [[cnoreabbrev q CustomCloseBuffer ]] --- vim.cmd [[cnoreabbrev qa q]] --- vim.cmd [[nnoremap ; :]] +vim.keymap.set("n", "", close_floating, { desc = "Close floats, clear highlights" }) local builtin = require('telescope.builtin') -vim.keymap.set('n', 's', "vertical sb", {}) -vim.keymap.set('n', '', builtin.find_files, {}) -vim.keymap.set('n', 'f', builtin.live_grep, {}) -vim.keymap.set('n', 'h', builtin.pickers, {}) --- vim.keymap.set('n', 'h', builtin.search_history, {}) -vim.keymap.set('n', 'b', function() builtin.buffers({sort_mru = true}) end, {}) -vim.keymap.set('n', 'd', function() require('telescope.builtin').diagnostics({ severity_bound = 0, bufnr = 0 }) end, {}) -vim.keymap.set('n', 'ad', function() require('telescope.builtin').diagnostics({ severity_bound = 0 }) end, {}) -vim.keymap.set('n', 'em', "RustLsp expandMacro") -vim.keymap.set("n", "]d", vim.diagnostic.goto_next) -vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) - - -vim.keymap.set('n', 'ct', "CustomCloseBuffer") -vim.keymap.set('n', 'co', "silent! BufferCloseAllButCurrent") -vim.keymap.set('n', 'cl', "silent! BufferCloseBuffersLeft") -vim.keymap.set('n', 'cr', "silent! BufferCloseBuffersRight") - --- like quit but for a single tab -vim.keymap.set('n', 'q', "BufferClose", {}) -vim.keymap.set('n', 'oq', "BufOnly", {}) - vim.keymap.set("n", "x", require("telescope.builtin").resume, { noremap = true, silent = true, @@ -298,3 +213,36 @@ vim.g.VM_reselect_first = 1 vim.g.VM_notify_previously_selected = 1 vim.g.VM_theme = "iceblue" + + +-- workaround for rust-analyzer server cancelled request +for _, method in ipairs { 'textDocument/diagnostic', 'workspace/diagnostic' } do + local default_diagnostic_handler = vim.lsp.handlers[method] + vim.lsp.handlers[method] = function(err, result, context, config) + if err ~= nil and err.code == -32802 then + return + end + return default_diagnostic_handler(err, result, context, config) + end +end + +require("hover").setup { + init = function() + require("hover.providers.lsp") + require('hover.providers.gh') + require('hover.providers.diagnostic') + end, + preview_opts = { + border = 'rounded' + }, + -- Whether the contents of a currently open hover window should be moved + -- to a :h preview-window when pressing the hover keymap. + preview_window = false, + title = true, +} + +-- Setup keymaps +vim.keymap.set("n", "K", require("hover").hover, {desc = "hover.nvim"}) +vim.keymap.set("n", "gK", require("hover").hover_select, {desc = "hover.nvim (select)"}) +-- vim.keymap.set("n", "", function() require("hover").hover_switch("previous") end, {desc = "hover.nvim (previous source)"}) +-- vim.keymap.set("n", "", function() require("hover").hover_switch("next") end, {desc = "hover.nvim (next source)"}) diff --git a/programs/nvim/default.nix b/programs/nvim/default.nix index 6ab0753..e3b1151 100644 --- a/programs/nvim/default.nix +++ b/programs/nvim/default.nix @@ -1,9 +1,4 @@ -{ pkgs, ... }: -let - map = mode: key: action: { - inherit mode key action; - }; -in +{ pkgs, inputs, ... }: { home = { sessionVariables = { @@ -14,6 +9,7 @@ in imports = [ ./options.nix ./plugins.nix + ./keys.nix ]; programs.nixvim = { @@ -47,64 +43,8 @@ in extraLuaPackages = ps: [ ps.magick ]; extraPackages = [ pkgs.imagemagick ]; - # package = pkgs.neovim-unwrapped; - package = (pkgs.neovim-unwrapped.override { lua = pkgs.luajit; }).overrideAttrs (_: { - version = "git"; - src = pkgs.fetchFromGitHub { - owner = "neovim"; - repo = "neovim"; - rev = "76dcc7029b200e1d85024d7ba4a34c602e730dbe"; - hash = "sha256-y3LmGebXuQhLz9w1IzkDU8b464WvMvPCbIImpVvxmcI="; - }; - buildInputs = - [ - (pkgs.utf8proc.overrideAttrs (_: { - version = "git"; - - src = pkgs.fetchFromGitHub { - owner = "JuliaStrings"; - repo = "utf8proc"; - rev = "3de4596fbe28956855df2ecb3c11c0bbc3535838"; - hash = "sha256-DNnrKLwks3hP83K56Yjh9P3cVbivzssblKIx4M/RKqw="; - }; - - })) - ] - ++ pkgs.neovim-unwrapped.buildInputs - ++ pkgs.neovim-unwrapped.nativeBuildInputs; - }); - - keymaps = [ - { - key = ""; - action = "Lspsaga rename"; - } - { - key = "o"; - action = "Lspsaga outline"; - } - { - key = "."; - action = "Lspsaga code_action"; - } - - # { - # key = "/"; - # action = "lua require('spectre').open_file_search({select_word=true})"; - # } - - (map "n" "t" "Neotree toggle") - - # tab for indent/dedent - (map "n" "" ">>_") - (map "n" "" "<<_") - (map "i" "" "") - (map "v" "" ">gv") - (map "v" "" "lua ${action}"; + telescope = "require('telescope.builtin')"; +in +{ + programs.nixvim.keymaps = [ + (map "" "" "Lspsaga rename") + (map "" "o" "Lspsaga outline") + (map "" "." "Lspsaga code_action") + + # splitting + (map "n" "s" "vertical sb") + + # closing + (map "n" "w" "BufferClose") # single buffer + (map "n" "cb" "BufferClose") # single buffer + + (map "n" "ct" "CloseBuffer") # buffer or extra tab + (map "n" "q" "CloseBuffer") # buffer or extra tab + + (map "n" "co" "silent! BufferCloseAllButVisible") # other buffers + (map "n" "cl" "silent! BufferCloseBuffersLeft") # other buffers (left) + (map "n" "cr" "silent! BufferCloseBuffersRight") # other buffers (right) + + # moving + (map "n" "mL" "BufferMovePrevious") # left + (map "n" "mr" "BufferMoveNext") # right + (map "n" "m0" "BufferMoveStart") # start + (map "n" "m$" "BufferMoveEnd") # end + + (map "n" "jb" "BufferPick") # jump to tab + + # jumplist + # (map "n" "" "") + # (map "n" "" "") + (luamap "n" "r" "${telescope}.jumplist()") + + # pickers + (luamap "n" "" "${telescope}.find_files()") + (luamap "n" "f" "${telescope}.live_grep()") + (luamap "n" "t" "${telescope}.lsp_document_symbols()") + (luamap "n" "T" "${telescope}.lsp_dynamic_workspace_symbols()") + # last used pickers/searches + (luamap "n" "h" "${telescope}.pickers()") + # open buffers + (luamap "n" "b" "${telescope}.buffers({sort_mru = true})") + + # diagnostics + (map "n" "d" "Trouble diagnostics toggle filter.buf=0") + (map "n" "ad" "Trouble diagnostics toggle") + (luamap "n" "]d" + "vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR, wrap=true })" + ) + (luamap "n" "[d" + "vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR, wrap=true })" + ) + (luamap "n" "]w" "vim.diagnostic.goto_next({ wrap=true })") + (luamap "n" "[w" "vim.diagnostic.goto_prev({ wrap=true })") + + # docs with control-d just like in autocomplete + (map "n" "" "K") + + # expand macro + (map "n" "em" "RustLsp expandMacro") + + # easier quitting etc + (map "ca" "W" "w") + (map "ca" "X" "x") + + (map "ca" "Q" "CloseBuffer") + (map "ca" "q" "CloseBuffer") + + # navigation + (map "" "" "") + (map "" "" "") + (map "" "" "") + (map "" "" "") + (map "" "" "") + + # { + # key = "/"; + # action = "lua require('spectre').open_file_search({select_word=true})"; + # } + + (map "n" "t" "Neotree toggle") + + # tab for indent/dedent + (map "n" "" ">>_") + (map "n" "" "<<_") + (map "i" "" "") + (map "v" "" ">gv") + (map "v" "" "