diff --git a/flake.lock b/flake.lock index 5a318dc..4d6dab4 100644 --- a/flake.lock +++ b/flake.lock @@ -23,6 +23,27 @@ "type": "github" } }, + "crane": { + "inputs": { + "nixpkgs": [ + "ironbar", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717025063, + "narHash": "sha256-dIubLa56W9sNNz0e8jGxrX3CAkPXsq7snuFA/Ie6dn8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "480dff0be03dac0e51a8dfc26e882b0d123a450e", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -66,6 +87,28 @@ "type": "github" } }, + "devshell": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", + "owner": "numtide", + "repo": "devshell", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -98,16 +141,82 @@ "type": "github" } }, - "flake-utils": { + "flake-compat_3": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "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-parts": { "inputs": { - "systems": "systems_2" + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-root": { + "locked": { + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", + "owner": "srid", + "repo": "flake-root", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -118,7 +227,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -136,7 +245,43 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" + }, + "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_4": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_7" }, "locked": { "lastModified": 1705309234, @@ -152,9 +297,9 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_6": { "inputs": { - "systems": "systems_6" + "systems": "systems_9" }, "locked": { "lastModified": 1681202837, @@ -170,6 +315,55 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716213921, + "narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0", + "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", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -198,32 +392,246 @@ ] }, "locked": { - "lastModified": 1716729592, - "narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=", + "lastModified": 1716736833, + "narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=", "owner": "rycee", "repo": "home-manager", - "rev": "2c78a57c544dd19b07442350727ced097e1aa6e6", + "rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6", "type": "github" }, "original": { "owner": "rycee", - "ref": "release-23.11", + "ref": "release-24.05", "repo": "home-manager", "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1717052710, + "narHash": "sha256-LRhOxzXmOza5SymhOgnEzA8EAQp+94kkeUYWKKpLJ/U=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1716576411, + "narHash": "sha256-FIN1wMoyePBTtibCbaeJaoKNLuAYIGwLCWAYC1DJanw=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "57298fc4f13c807e50ada2c986a3114b7fc2e621", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprcursor": "hyprcursor", + "hyprlang": "hyprlang", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs", + "systems": "systems_2", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1717442018, + "narHash": "sha256-GhL4f5CedZE0UiuzUFkMwGXD+zqlhrzo0y4FC4wQLTM=", + "ref": "refs/heads/main", + "rev": "5517cc506b2754cb2485b1bf3e46918ee638ea6d", + "revCount": 4760, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ], + "systems": [ + "hyprland", + "xdph", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1716473782, + "narHash": "sha256-+qLn4lsHU6iL3+HTo1gTQ1tWzet8K9h+IfVemzEQZj8=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "87d5d984109c839482b88b4795db073eb9ed446f", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1716058375, + "narHash": "sha256-CwjWoVnBZE5SBpRx9dgSQGCr4Goxyfcyv3zZbOhVqzk=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "3afed4364790aebe0426077631af1e164a9650cc", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "ironbar": { + "inputs": { + "crane": "crane", + "naersk": "naersk", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1717443201, + "narHash": "sha256-a0ZXSNQvklHhUkCnX+4wGN8Bu5WkG+I85h7NcKlehdk=", + "owner": "JakeStanger", + "repo": "ironbar", + "rev": "6e921eb567164f4ad46a7c74d665b3dc6223f928", + "type": "github" + }, + "original": { + "owner": "JakeStanger", + "repo": "ironbar", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1717067539, + "narHash": "sha256-oIs5EF+6VpHJRvvpVWuqCYJMMVW/6h59aYUv9lABLtY=", + "owner": "nix-community", + "repo": "naersk", + "rev": "fa19d8c135e776dc97f4dcca08656a0eeb28d5c0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "naersk", + "type": "github" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1716993688, + "narHash": "sha256-vo5k2wQekfeoq/2aleQkBN41dQiQHNTniZeVONWiWLs=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "c0d5b8c54d6828516c97f6be9f2d00c63a363df4", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, "nix-vscode-extensions": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1717032429, - "narHash": "sha256-1+87CE8xOUsJChiq9aNQqWPKoWMuyurW+aXrGbMWH7I=", + "lastModified": 1717377936, + "narHash": "sha256-6inBsoiYEsTNJExq1G+0imL5pcDx1IkPf7PUqHARwmU=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "0309d806a5431a46fb7fd81e20d7133ac8b1de55", + "rev": "1ae16af500525f1ca1b3295f5ee4e2b1b26f3004", "type": "github" }, "original": { @@ -235,7 +643,7 @@ "nixos-wsl": { "inputs": { "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ] @@ -255,6 +663,36 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1716330097, + "narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1717112898, + "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1713805509, "narHash": "sha256-YgSEan4CcrjivCNO5ZNzhg7/8ViLkZ4CB/GrGBVSudo=", @@ -270,22 +708,22 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_4": { "locked": { - "lastModified": 1716633019, - "narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=", + "lastModified": 1717144377, + "narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e", + "rev": "805a384895c696f802a9bf5bf4720f37385df547", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "type": "indirect" } }, - "nixpkgs_3": { + "nixpkgs_5": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -301,13 +739,41 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "git-hooks": "git-hooks", + "home-manager": "home-manager_3", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1717444597, + "narHash": "sha256-8enVHsN7hLn1hPkY1U5Cfr3rzij4FsWRUx4jjHUHZQE=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "b7a8b0319098fdbaa719ef4dc375337ec4543c6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, "nur": { "locked": { - "lastModified": 1717040447, - "narHash": "sha256-A1vpWk46+zB+j7ZzNYleA0PuYFktxBkBs/3qsL6yX6k=", + "lastModified": 1717443933, + "narHash": "sha256-hKPYAOnbqvy/eZMsp85KRHn5+K3QkGeU8cyLiXtxT48=", "owner": "nix-community", "repo": "NUR", - "rev": "f5637ea4eaddf95edc3844466c16c56bd44a7f30", + "rev": "0122b0f415811dd2a367f362a595070b6451ff9a", "type": "github" }, "original": { @@ -321,11 +787,14 @@ "agenix": "agenix", "darwin": "darwin_2", "home-manager": "home-manager_2", + "hyprland": "hyprland", + "ironbar": "ironbar", "nix-vscode-extensions": "nix-vscode-extensions", "nixos-wsl": "nixos-wsl", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_4", + "nixvim": "nixvim", "nur": "nur", - "rust-overlay": "rust-overlay", + "rust-overlay": "rust-overlay_2", "unstable": "unstable", "utils": "utils", "vscode-server": "vscode-server" @@ -333,15 +802,37 @@ }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils", + "nixpkgs": [ + "ironbar", + "nixpkgs" + ] }, "locked": { - "lastModified": 1717035469, - "narHash": "sha256-MzH+yjKULH3HCRj9QCTwBvqq4LZkR0ZqRE/QfGOGC2E=", + "lastModified": 1717121863, + "narHash": "sha256-/3sxIe7MZqF/jw1RTQCSmgTjwVod43mmrk84m50MJQ4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "095702e63a40e86f339d11864da9dc965b70a01e", + "rev": "2a7b53172ed08f856b8382d7dcfd36a4e0cbd866", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1717442957, + "narHash": "sha256-w0fqHofxM2hf3pGDXCPSdH0A09v6FgHm6I38nCWA96k=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "025e1742de4fa75b3fb63818bd9726d17da6a102", "type": "github" }, "original": { @@ -367,16 +858,16 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -440,13 +931,79 @@ "type": "github" } }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1715940852, + "narHash": "sha256-wJqHMg/K6X3JGAE9YLM0LsuKrKb4XiBeVaoeMNlReZg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2fba33a182602b9d49f0b2440513e5ee091d838b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "unstable": { "locked": { - "lastModified": 1716769173, - "narHash": "sha256-7EXDb5WBw+d004Agt+JHC/Oyh/KTUglOaQ4MNjBbo5w=", + "lastModified": 1717196966, + "narHash": "sha256-yZKhxVIKd2lsbOqYd5iDoUIwsRZFqE87smE2Vzf6Ck0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9ca3f649614213b2aaf5f1e16ec06952fe4c2632", + "rev": "57610d2f8f0937f39dbd72251e9614b1561942d8", "type": "github" }, "original": { @@ -457,7 +1014,7 @@ }, "utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_8" }, "locked": { "lastModified": 1710146030, @@ -475,7 +1032,7 @@ }, "vscode-server": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nixpkgs" ] @@ -493,6 +1050,36 @@ "repo": "nixos-vscode-server", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": "hyprland-protocols", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1716290197, + "narHash": "sha256-1u9Exrc7yx9qtES2brDh7/DDZ8w8ap1nboIOAtCgeuM=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "91e48d6acd8a5a611d26f925e51559ab743bc438", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 04db89d..dc12d21 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,34 @@ description = "Michael Thomas's NixOS configuration"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.11"; + nixpkgs.url = "nixpkgs/nixos-24.05"; unstable.url = "nixpkgs/nixos-unstable"; nur.url = "github:nix-community/NUR"; + home-manager = { + url = "github:rycee/home-manager/release-24.05"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + darwin = { + url = "github:lnl7/nix-darwin/master"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + utils.url = "github:numtide/flake-utils"; + nixvim = { + # url = "github:nix-community/nixvim/nixos-24.05"; + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; rust-overlay.url = "github:oxalica/rust-overlay"; nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; - + hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; + ironbar = { + url = "github:JakeStanger/ironbar"; + inputs.nixpkgs.follows = "nixpkgs"; + }; agenix = { url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -25,18 +45,6 @@ url = "github:nix-community/nixos-vscode-server"; inputs.nixpkgs.follows = "nixpkgs"; }; - - darwin = { - url = "github:lnl7/nix-darwin/master"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - - home-manager = { - url = "github:rycee/home-manager/release-23.11"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; - }; }; outputs = { @@ -64,7 +72,11 @@ in { # Your custom packages # Accessible through 'nix build', 'nix shell', etc - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + packages = forAllSystems (system: + import ./pkgs { + pkgs = nixpkgs.legacyPackages.${system}; + inherit inputs; + }); overlays = import ./overlays {inherit inputs;}; @@ -72,7 +84,16 @@ nixpkgs.overlays = builtins.attrValues self.overlays; }; - nixosConfigurations = { + nixosConfigurations = let + baseHomeModule = { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.extraSpecialArgs = {inherit inputs;}; + }; + homeModule = baseHomeModule // { + home-manager.users.michael = import ./user/environments/nixos/home.nix; + }; + in { kitchen = nixpkgs.lib.nixosSystem { system = utils.lib.system.x86_64-linux; modules = @@ -80,11 +101,7 @@ ++ [ ./modules/common.nix ./modules/containers.nix - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/kitchen/configuration.nix ]; @@ -99,11 +116,7 @@ ./modules/common.nix ./modules/hyprland.nix ./modules/containers.nix - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/thinkcentre/configuration.nix agenix.nixosModules.default @@ -125,11 +138,7 @@ ./modules/hyprland.nix ./modules/containers.nix ./modules/applications/steam - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.michael = import ./user/environments/nixos/home.nix; - } + homeModule ./machines/terra/configuration.nix agenix.nixosModules.default @@ -148,9 +157,8 @@ defaultModules ++ [ ./modules/nix.nix + baseHomeModule { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.users.michael = import ./user/environments/nixos-server/home.nix; } agenix.nixosModules.default @@ -188,9 +196,8 @@ modules = [ self.overlaysModule home-manager.darwinModules.home-manager + baseHomeModule { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; home-manager.users.michael = import ./user/environments/mac/home.nix; } diff --git a/machines/oracle/configuration.nix b/machines/oracle/configuration.nix index 48ebe9f..b5b4188 100644 --- a/machines/oracle/configuration.nix +++ b/machines/oracle/configuration.nix @@ -38,6 +38,10 @@ publicKey = "iKJO9Q8LsdCdApapTX9CJmrtAKn1TYhg4YUiBUBPzmo="; allowedIPs = ["10.0.10.2/32"]; } + { + publicKey = "IM7i+2BFsa+XyA4V4jd8iM+jpW307rDEkPOGdSddfzI="; + allowedIPs = ["10.0.10.3/32"]; + } ]; }; }; diff --git a/machines/terra/configuration.nix b/machines/terra/configuration.nix index c4f853c..7c90e83 100644 --- a/machines/terra/configuration.nix +++ b/machines/terra/configuration.nix @@ -1,8 +1,4 @@ -{ - config, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -13,7 +9,7 @@ networking.firewall = { enable = true; }; - networking.networkmanager.enable=true; + networking.networkmanager.enable = true; # Set your time zone. time.timeZone = "America/New_York"; @@ -34,9 +30,9 @@ }; # Configure keymap in X11 - services.xserver = { + services.xserver.xkb = { layout = "us"; - xkbVariant = ""; + variant = ""; }; services.openssh = { @@ -49,12 +45,13 @@ }; programs.zsh.enable = true; + environment.variables.EDITOR = "nvim"; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.michael = { isNormalUser = true; description = "Michael Thomas"; - extraGroups = ["wheel" "docker" "podman" "adbusers" "dialout"]; + extraGroups = ["wheel" "docker" "podman" "adbusers" "dialout" "libvirtd"]; shell = pkgs.zsh; openssh.authorizedKeys.keys = [ # Neptune @@ -64,6 +61,18 @@ ]; }; + # Enablle libvirtd + virtualisation.libvirtd.enable = true; + boot.kernelModules = ["kvm-amd" "kvm-intel"]; + + environment.systemPackages = with pkgs; [ + obs-studio + virt-manager + # GTK Discord Client + unstable.dissent + kdenlive + ]; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/modules/applications/steam/default.nix b/modules/applications/steam/default.nix index cb00c75..01a2b5f 100644 --- a/modules/applications/steam/default.nix +++ b/modules/applications/steam/default.nix @@ -1,6 +1,7 @@ -{ +{pkgs, ...}: { programs.steam = { enable = true; + package = pkgs.unstable.steam; gamescopeSession.enable = true; }; } diff --git a/modules/avahi.nix b/modules/avahi.nix index 7a5bde0..e0b8145 100644 --- a/modules/avahi.nix +++ b/modules/avahi.nix @@ -2,7 +2,7 @@ # Enable Avahi Network Discovery services.avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; publish.enable = true; publish.addresses = true; }; diff --git a/modules/hyprland.nix b/modules/hyprland.nix index 0a3243c..b4d32fe 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -1,19 +1,28 @@ -{pkgs, ...}: { +{ + pkgs, + inputs, + ... +}: let + pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; +in { programs.hyprland = { enable = true; - package = pkgs.unstable.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + }; + + hardware.opengl = { + package = pkgs-hyprland.mesa.drivers; + driSupport32Bit = true; + package32 = pkgs-hyprland.pkgsi686Linux.mesa.drivers; }; services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; environment.systemPackages = with pkgs; [ # Theme adw-gtk3 - # Greeter - cage - greetd.gtkgreet - # Applications gnome.nautilus gnome.sushi @@ -33,11 +42,23 @@ # Required for Nautilus to work outside GNOME services.gvfs.enable = true; + # Use CAPSLOCK as Hyper key + services.keyd = { + enable = true; + keyboards.default = { + ids = ["*"]; + settings.main = { + capslock = "overload(meta, esc)"; + }; + }; + }; + services.greetd = { enable = true; settings = { default_session = { - command = "cage -s -- gtkgreet --command=Hyprland"; + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland"; + user = "greeter"; }; }; }; diff --git a/modules/services/forgejo/default.nix b/modules/services/forgejo/default.nix index e303008..4e57c68 100644 --- a/modules/services/forgejo/default.nix +++ b/modules/services/forgejo/default.nix @@ -93,6 +93,10 @@ in { }) (mkIf cfg.proxy { services.caddy.virtualHosts."${forgejoDomain}".extraConfig = '' + handle_errors { + respond "This server is currently unavailable." 502 + } + redir /user/login /user/oauth2/Keycloak?{query} reverse_proxy http://${proxyIP}:${toString cfg.port} diff --git a/modules/services/homer/default.nix b/modules/services/homer/default.nix index ff5527d..e3a454f 100644 --- a/modules/services/homer/default.nix +++ b/modules/services/homer/default.nix @@ -11,6 +11,22 @@ with lib; let title = "Dashboard"; header = false; footer = false; + colors = { + dark = { + highlight-primary = "#cc241d"; + highlight-secondary = "#8ec07c"; + highlight-hover = "#d79921"; + background = "rgb(40,36,34)"; + card-background = "#3c3836"; + text = "#eaeaea"; + text-header = "#ffffff"; + text-title = "#fafafa"; + text-subtitle = "#f5f5f5"; + card-shadow = "rgba(0, 0, 0, 0.4)"; + link = "#3273dc"; + link-hover = "#ffdd57"; + }; + }; connectivityCheck = true; columns = "auto"; services = config.lib.webapps.homerServices; diff --git a/modules/yabai.nix b/modules/yabai.nix index 41fa5b5..cc07b98 100644 --- a/modules/yabai.nix +++ b/modules/yabai.nix @@ -74,6 +74,9 @@ | xargs -I{} yabai -m query --windows --space {} \ | jq -sre "add | map(select(.minimized != 1)) | sort_by(.display, .frame.y, .frame.x, .id) | reverse | nth(index(map(select(.focused == 1))) - 1).id" \ | xargs -I{} yabai -m window --focus {} + + # applications + ctrl + alt - t: open -n -a 'Alacritty.app' ''; }; } diff --git a/overlays/default.nix b/overlays/default.nix index 85e4b9f..b9cb445 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,7 +3,11 @@ vscode-extensions = inputs.nix-vscode-extensions.overlays.default; # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: import ../pkgs final.pkgs; + additions = final: _prev: + import ../pkgs { + pkgs = final.pkgs; + inherit inputs; + }; # This one contains whatever you want to overlay # You can change versions, add patches, set compilation flags, anything really. diff --git a/pkgs/default.nix b/pkgs/default.nix index 7894653..bb4c612 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,5 @@ -pkgs: { +{pkgs, ...} @ args: { homer = pkgs.callPackage ./homer {}; keycloak-theme-keywind = pkgs.callPackage ./keywind {}; + nvim-custom = import ./nvim/default.nix args; } diff --git a/pkgs/nvim/config/bufferlines/bufferline.nix b/pkgs/nvim/config/bufferlines/bufferline.nix new file mode 100644 index 0000000..9b717cd --- /dev/null +++ b/pkgs/nvim/config/bufferlines/bufferline.nix @@ -0,0 +1,125 @@ +{ + plugins = { + bufferline = { + enable = true; + separatorStyle = "thick"; # “slant”, “padded_slant”, “slope”, “padded_slope”, “thick”, “thin” + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + ]; + }; + }; + keymaps = [ + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + + { + mode = "n"; + key = "bd"; + action = "bdelete"; + options = { + desc = "Delete buffer"; + }; + } + + { + mode = "n"; + key = "bb"; + action = "e #"; + options = { + desc = "Switch to Other Buffer"; + }; + } + + # { + # mode = "n"; + # key = "`"; + # action = "e #"; + # options = { + # desc = "Switch to Other Buffer"; + # }; + # } + + { + mode = "n"; + key = "br"; + action = "BufferLineCloseRight"; + options = { + desc = "Delete buffers to the right"; + }; + } + + { + mode = "n"; + key = "bl"; + action = "BufferLineCloseLeft"; + options = { + desc = "Delete buffers to the left"; + }; + } + + { + mode = "n"; + key = "bo"; + action = "BufferLineCloseOthers"; + options = { + desc = "Delete other buffers"; + }; + } + + { + mode = "n"; + key = "bp"; + action = "BufferLineTogglePin"; + options = { + desc = "Toggle pin"; + }; + } + + { + mode = "n"; + key = "bP"; + action = "BufferLineGroupClose ungrouped"; + options = { + desc = "Delete non-pinned buffers"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/colorschemes/base16.nix b/pkgs/nvim/config/colorschemes/base16.nix new file mode 100644 index 0000000..ffea1b3 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/base16.nix @@ -0,0 +1,8 @@ +{ + colorschemes = { + base16 = { + enable = false; + colorscheme = "mountain"; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/catppuccin.nix b/pkgs/nvim/config/colorschemes/catppuccin.nix new file mode 100644 index 0000000..312d28a --- /dev/null +++ b/pkgs/nvim/config/colorschemes/catppuccin.nix @@ -0,0 +1,48 @@ +{ + colorschemes = { + catppuccin = { + enable = true; + settings = { + background = { + light = "macchiato"; + dark = "mocha"; + }; + flavour = "mocha"; # "latte", "mocha", "frappe", "macchiato" or raw lua code + disable_bold = false; + disable_italic = false; + disable_underline = false; + transparent_background = true; + term_colors = true; + integrations = { + cmp = true; + noice = true; + notify = true; + neotree = true; + harpoon = true; + gitsigns = true; + which_key = true; + illuminate = { + enabled = true; + }; + treesitter = true; + treesitter_context = true; + telescope.enabled = true; + indent_blankline.enabled = true; + mini.enabled = true; + native_lsp = { + enabled = true; + inlay_hints = { + background = true; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + information = ["underline"]; + warnings = ["underline"]; + }; + }; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/colorschemes/rose-pine.nix b/pkgs/nvim/config/colorschemes/rose-pine.nix new file mode 100644 index 0000000..2077010 --- /dev/null +++ b/pkgs/nvim/config/colorschemes/rose-pine.nix @@ -0,0 +1,14 @@ +{ + colorschemes = { + rose-pine = { + enable = false; + settings = { + styles = { + italic = true; + bold = true; + transparency = false; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/completion/cmp.nix b/pkgs/nvim/config/completion/cmp.nix new file mode 100644 index 0000000..012ff9e --- /dev/null +++ b/pkgs/nvim/config/completion/cmp.nix @@ -0,0 +1,130 @@ +{ + plugins = { + cmp-nvim-lsp = {enable = true;}; # lsp + cmp-buffer = {enable = true;}; + copilot-cmp = {enable = true;}; # copilot suggestions + cmp-path = {enable = true;}; # file system paths + cmp_luasnip = {enable = true;}; # snippets + cmp-cmdline = {enable = false;}; # autocomplete for cmdline + cmp = { + enable = true; + autoEnableSources = false; + settings = { + experimental = { + ghost_text = true; + }; + }; + settings = { + mapping = { + __raw = '' + cmp.mapping.preset.insert({ + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.abort(), + + [''] = cmp.mapping.scroll_docs(-4), + + [''] = cmp.mapping.scroll_docs(4), + + [''] = cmp.mapping.complete(), + + [''] = cmp.mapping.confirm({ select = true }), + + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + }) + ''; + }; + snippet = { + expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + }; + sources = { + __raw = '' + cmp.config.sources({ + {name = 'nvim_lsp'}, + {name = 'copilot'}, + {name = 'path'}, + {name = 'luasnip'}, + {name = 'cmdline'}, + }, { + {name = 'buffer'}, + }) + ''; + }; + performance = { + debounce = 60; + fetching_timeout = 200; + max_view_entries = 30; + }; + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None"; + }; + documentation = { + border = "rounded"; + }; + }; + formatting = { + fields = ["kind" "abbr" "menu"]; + expandable_indicator = true; + }; + }; + }; + }; + extraConfigLua = '' + luasnip = require("luasnip") + kind_icons = { + Text = "󰊄", + Method = "", + Function = "󰡱", + Constructor = "", + Field = "", + Variable = "󱀍", + Class = "", + Interface = "", + Module = "󰕳", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } + + local cmp = require'cmp' + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({'/', "?" }, { + sources = { + { name = 'buffer' } + } + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }), + }) ''; +} diff --git a/pkgs/nvim/config/completion/copilot.nix b/pkgs/nvim/config/completion/copilot.nix new file mode 100644 index 0000000..4f8be48 --- /dev/null +++ b/pkgs/nvim/config/completion/copilot.nix @@ -0,0 +1,46 @@ +{ + plugins.copilot-lua = { + enable = true; + panel = { + enabled = false; + autoRefresh = true; + keymap = { + jumpPrev = "[["; + jumpNext = "]]"; + accept = ""; + refresh = "gr"; + open = ""; + }; + layout = { + position = "bottom"; # | top | left | right + ratio = 0.4; + }; + }; + suggestion = { + enabled = false; + autoTrigger = true; + debounce = 75; + keymap = { + accept = ""; + acceptWord = false; + acceptLine = false; + next = ""; + prev = ""; + dismiss = ""; + }; + }; + filetypes = { + yaml = false; + markdown = false; + help = false; + gitcommit = false; + gitrebase = false; + hgcommit = false; + svn = false; + cvs = false; + "." = false; + }; + copilotNodeCommand = "node"; # Node.js version must be > 18.x + serverOptsOverrides = {}; + }; +} diff --git a/pkgs/nvim/config/completion/lspkind.nix b/pkgs/nvim/config/completion/lspkind.nix new file mode 100644 index 0000000..69e8f78 --- /dev/null +++ b/pkgs/nvim/config/completion/lspkind.nix @@ -0,0 +1,12 @@ +{ + plugins.lspkind = { + enable = true; + symbolMap = { + Copilot = ""; + }; + extraOptions = { + maxwidth = 50; + ellipsis_char = "..."; + }; + }; +} diff --git a/pkgs/nvim/config/dap/dap.nix b/pkgs/nvim/config/dap/dap.nix new file mode 100644 index 0000000..20fe615 --- /dev/null +++ b/pkgs/nvim/config/dap/dap.nix @@ -0,0 +1,222 @@ +{ + plugins.dap = { + enable = true; + signs = { + dapBreakpoint = { + text = "●"; + texthl = "DapBreakpoint"; + }; + dapBreakpointCondition = { + text = "●"; + texthl = "DapBreakpointCondition"; + }; + dapLogPoint = { + text = "◆"; + texthl = "DapLogPoint"; + }; + }; + extensions = { + dap-python = { + enable = true; + }; + dap-ui = { + enable = true; + floating.mappings = { + close = ["" "q"]; + }; + }; + dap-virtual-text = { + enable = true; + }; + }; + configurations = { + java = [ + { + type = "java"; + request = "launch"; + name = "Debug (Attach) - Remote"; + hostName = "127.0.0.1"; + port = 5005; + } + ]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "dB"; + action = " + lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) + "; + options = { + silent = true; + desc = "Breakpoint Condition"; + }; + } + { + mode = "n"; + key = "db"; + action = ":DapToggleBreakpoint"; + options = { + silent = true; + desc = "Toggle Breakpoint"; + }; + } + { + mode = "n"; + key = "dc"; + action = ":DapContinue"; + options = { + silent = true; + desc = "Continue"; + }; + } + { + mode = "n"; + key = "da"; + action = "lua require('dap').continue({ before = get_args })"; + options = { + silent = true; + desc = "Run with Args"; + }; + } + { + mode = "n"; + key = "dC"; + action = "lua require('dap').run_to_cursor()"; + options = { + silent = true; + desc = "Run to cursor"; + }; + } + { + mode = "n"; + key = "dg"; + action = "lua require('dap').goto_()"; + options = { + silent = true; + desc = "Go to line (no execute)"; + }; + } + { + mode = "n"; + key = "di"; + action = ":DapStepInto"; + options = { + silent = true; + desc = "Step into"; + }; + } + { + mode = "n"; + key = "dj"; + action = " + lua require('dap').down() + "; + options = { + silent = true; + desc = "Down"; + }; + } + { + mode = "n"; + key = "dk"; + action = "lua require('dap').up()"; + options = { + silent = true; + desc = "Up"; + }; + } + { + mode = "n"; + key = "dl"; + action = "lua require('dap').run_last()"; + options = { + silent = true; + desc = "Run Last"; + }; + } + { + mode = "n"; + key = "do"; + action = ":DapStepOut"; + options = { + silent = true; + desc = "Step Out"; + }; + } + { + mode = "n"; + key = "dO"; + action = ":DapStepOver"; + options = { + silent = true; + desc = "Step Over"; + }; + } + { + mode = "n"; + key = "dp"; + action = "lua require('dap').pause()"; + options = { + silent = true; + desc = "Pause"; + }; + } + { + mode = "n"; + key = "dr"; + action = ":DapToggleRepl"; + options = { + silent = true; + desc = "Toggle REPL"; + }; + } + { + mode = "n"; + key = "ds"; + action = "lua require('dap').session()"; + options = { + silent = true; + desc = "Session"; + }; + } + { + mode = "n"; + key = "dt"; + action = ":DapTerminate"; + options = { + silent = true; + desc = "Terminate"; + }; + } + { + mode = "n"; + key = "du"; + action = "lua require('dapui').toggle()"; + options = { + silent = true; + desc = "Dap UI"; + }; + } + { + mode = "n"; + key = "dw"; + action = "lua require('dap.ui.widgets').hover()"; + options = { + silent = true; + desc = "Widgets"; + }; + } + { + mode = ["n" "v"]; + key = "de"; + action = "lua require('dapui').eval()"; + options = { + silent = true; + desc = "Eval"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/default.nix b/pkgs/nvim/config/default.nix new file mode 100644 index 0000000..1a3e5fe --- /dev/null +++ b/pkgs/nvim/config/default.nix @@ -0,0 +1,84 @@ +{ + # Import all your configuration modules here + imports = [ + ./sets.nix + ./keymaps.nix + + ./bufferlines/bufferline.nix + + ./colorschemes/base16.nix + ./colorschemes/catppuccin.nix + ./colorschemes/rose-pine.nix + + ./completion/cmp.nix + ./completion/copilot.nix + ./completion/lspkind.nix + + ./dap/dap.nix + + ./filetrees/neo-tree.nix + ./git/gitsigns.nix + ./git/diffview.nix + ./git/lazygit.nix + # ./git/neogit.nix + + ./languages/nvim-jdtls.nix + ./languages/nvim-lint.nix + ./languages/typescript-tools-nvim.nix + ./languages/treesitter/treesitter.nix + ./languages/treesitter/treesitter-context.nix + ./languages/treesitter/treesitter-textobjects.nix + ./languages/treesitter/ts-autotag.nix + ./languages/treesitter/ts-context-commentstring.nix + + ./lsp/conform.nix + ./lsp/fidget.nix + ./lsp/lsp.nix + ./lsp/lspsaga.nix + ./lsp/trouble.nix + + ./none-ls/none-ls.nix + + ./snippets/luasnip.nix + + ./statusline/lualine.nix + ./statusline/staline.nix + + ./telescope/telescope.nix + + ./ui/alpha.nix + ./ui/dressing-nvim.nix + ./ui/indent-blankline.nix + ./ui/noice.nix + ./ui/nvim-notify.nix + ./ui/nui.nix + + ./utils/better-escape.nix + ./utils/neocord.nix + ./utils/flash.nix + ./utils/hardtime.nix + ./utils/harpoon.nix + ./utils/illuminate.nix + ./utils/markdown-preview.nix + ./utils/mini.nix + ./utils/neodev.nix + ./utils/neotest.nix + ./utils/nvim-autopairs.nix + ./utils/nvim-colorizer.nix + ./utils/nvim-surround.nix + ./utils/oil.nix + ./utils/persistence.nix + ./utils/plenary.nix + ./utils/project-nvim.nix + ./utils/sidebar.nix + ./utils/tmux-navigator.nix + ./utils/todo-comments.nix + ./utils/toggleterm.nix + ./utils/ultimate-autopair.nix + ./utils/undotree.nix + ./utils/vim-be-good.nix + # ./utils/wakatime.nix + ./utils/whichkey.nix + ./utils/wilder.nix + ]; +} diff --git a/pkgs/nvim/config/filetrees/neo-tree.nix b/pkgs/nvim/config/filetrees/neo-tree.nix new file mode 100644 index 0000000..c83589e --- /dev/null +++ b/pkgs/nvim/config/filetrees/neo-tree.nix @@ -0,0 +1,64 @@ +{ + plugins.neo-tree = { + enable = false; + enableDiagnostics = true; + enableGitStatus = true; + enableModifiedMarkers = true; + enableRefreshOnWrite = true; + closeIfLastWindow = true; + popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code + buffers = { + bindToCwd = false; + followCurrentFile = { + enabled = true; + }; + }; + window = { + width = 40; + height = 15; + autoExpandWidth = false; + mappings = { + "" = "none"; + }; + }; + }; + + # keymaps = [ + # { + # mode = "n"; + # key = "e"; + # action = ":Neotree toggle reveal_force_cwd"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (root dir)"; + # }; + # } + # { + # mode = "n"; + # key = "E"; + # action = "Neotree toggle"; + # options = { + # silent = true; + # desc = "Explorer NeoTree (cwd)"; + # }; + # } + # { + # mode = "n"; + # key = "be"; + # action = ":Neotree buffers"; + # options = { + # silent = true; + # desc = "Buffer explorer"; + # }; + # } + # { + # mode = "n"; + # key = "ge"; + # action = ":Neotree git_status"; + # options = { + # silent = true; + # desc = "Git explorer"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/git/diffview.nix b/pkgs/nvim/config/git/diffview.nix new file mode 100644 index 0000000..fa672d0 --- /dev/null +++ b/pkgs/nvim/config/git/diffview.nix @@ -0,0 +1,5 @@ +{ + plugins.diffview = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/git/gitsigns.nix b/pkgs/nvim/config/git/gitsigns.nix new file mode 100644 index 0000000..67814df --- /dev/null +++ b/pkgs/nvim/config/git/gitsigns.nix @@ -0,0 +1,92 @@ +{ + plugins.gitsigns = { + enable = true; + settings = { + trouble = true; + current_line_blame = false; + }; + }; + keymaps = [ + { + mode = ["n" "v"]; + key = "gh"; + action = "gitsigns"; + options = { + silent = true; + desc = "+hunks"; + }; + } + { + mode = "n"; + key = "ghb"; + action = ":Gitsigns blame_line"; + options = { + silent = true; + desc = "Blame line"; + }; + } + { + mode = "n"; + key = "ghd"; + action = ":Gitsigns diffthis"; + options = { + silent = true; + desc = "Diff This"; + }; + } + { + mode = "n"; + key = "ghp"; + action = ":Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview hunk"; + }; + } + { + mode = "n"; + key = "ghR"; + action = ":Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + { + mode = ["n" "v"]; + key = "ghr"; + action = ":Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + { + mode = ["n" "v"]; + key = "ghs"; + action = ":Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + { + mode = "n"; + key = "ghS"; + action = ":Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + { + mode = "n"; + key = "ghu"; + action = ":Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/lazygit.nix b/pkgs/nvim/config/git/lazygit.nix new file mode 100644 index 0000000..4ad017a --- /dev/null +++ b/pkgs/nvim/config/git/lazygit.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + lazygit-nvim + ]; + + extraConfigLua = '' + require("telescope").load_extension("lazygit") + ''; + + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + options = { + desc = "LazyGit (root dir)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/git/neogit.nix b/pkgs/nvim/config/git/neogit.nix new file mode 100644 index 0000000..a39a9ea --- /dev/null +++ b/pkgs/nvim/config/git/neogit.nix @@ -0,0 +1,12 @@ +{ + plugins.neogit = { + enable = true; + }; + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "Neogit"; + } + ]; +} diff --git a/pkgs/nvim/config/keymaps.nix b/pkgs/nvim/config/keymaps.nix new file mode 100644 index 0000000..64dd1bb --- /dev/null +++ b/pkgs/nvim/config/keymaps.nix @@ -0,0 +1,526 @@ +# Thanks for the keybinds primeagen and folke! +{ + globals.mapleader = " "; + + # TODO: Move general mappings to which-key + keymaps = [ + # Disable arrow keys + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Up arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Down arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Right arrow key"; + }; + } + { + mode = ["n" "i"]; + key = ""; + action = ""; + options = { + silent = true; + noremap = true; + desc = "Disable Left arrow key"; + }; + } + + # General maps + { + mode = "n"; + key = "f"; + action = "+find/file"; + } + + { + mode = "n"; + key = "s"; + action = "+search"; + } + + { + mode = "n"; + key = "q"; + action = "+quit/session"; + } + + { + mode = ["n" "v"]; + key = "g"; + action = "+git"; + } + + { + mode = "n"; + key = "u"; + action = "+ui"; + } + + { + mode = "n"; + key = "w"; + action = "+windows"; + } + + { + mode = "n"; + key = ""; + action = "+tab"; + } + + { + mode = ["n" "v"]; + key = "d"; + action = "+debug"; + } + + { + mode = ["n" "v"]; + key = "c"; + action = "+code"; + } + + { + mode = ["n" "v"]; + key = "t"; + action = "+test"; + } + + # Tabs + { + mode = "n"; + key = "l"; + action = "tablast"; + options = { + silent = true; + desc = "Last tab"; + }; + } + + { + mode = "n"; + key = "f"; + action = "tabfirst"; + options = { + silent = true; + desc = "First Tab"; + }; + } + + { + mode = "n"; + key = ""; + action = "tabnew"; + options = { + silent = true; + desc = "New Tab"; + }; + } + + { + mode = "n"; + key = "]"; + action = "tabnext"; + options = { + silent = true; + desc = "Next Tab"; + }; + } + + { + mode = "n"; + key = "d"; + action = "tabclose"; + options = { + silent = true; + desc = "Close tab"; + }; + } + + { + mode = "n"; + key = "["; + action = "tabprevious"; + options = { + silent = true; + desc = "Previous Tab"; + }; + } + + # Windows + { + mode = "n"; + key = "ww"; + action = "p"; + options = { + silent = true; + desc = "Other window"; + }; + } + + { + mode = "n"; + key = "wd"; + action = "c"; + options = { + silent = true; + desc = "Delete window"; + }; + } + + { + mode = "n"; + key = "w-"; + action = "s"; + options = { + silent = true; + desc = "Split window below"; + }; + } + + { + mode = "n"; + key = "w|"; + action = "v"; + options = { + silent = true; + desc = "Split window right"; + }; + } + + # { + # mode = "n"; + # key = "-"; + # action = "s"; + # options = { + # silent = true; + # desc = "Split window below"; + # }; + # } + + # { + # mode = "n"; + # key = "|"; + # action = "v"; + # options = { + # silent = true; + # desc = "Split window right"; + # }; + # } + + { + mode = "n"; + key = ""; + action = "w"; + options = { + silent = true; + desc = "Save file"; + }; + } + + # Quit/Session + { + mode = "n"; + key = "qq"; + action = "quitall"; + options = { + silent = true; + desc = "Quit all"; + }; + } + + { + mode = "n"; + key = "qs"; + action = ":lua require('persistence').load()"; + options = { + silent = true; + desc = "Restore session"; + }; + } + + { + mode = "n"; + key = "ql"; + action = "lua require('persistence').load({ last = true })"; + options = { + silent = true; + desc = "Restore last session"; + }; + } + + { + mode = "n"; + key = "qd"; + action = "lua require('persistence').stop()"; + options = { + silent = true; + desc = "Don't save current session"; + }; + } + + { + mode = "n"; + key = "ul"; + action = ":lua ToggleLineNumber()"; + options = { + silent = true; + desc = "Toggle Line Numbers"; + }; + } + + { + mode = "n"; + key = "uL"; + action = ":lua ToggleRelativeLineNumber()"; + options = { + silent = true; + desc = "Toggle Relative Line Numbers"; + }; + } + + { + mode = "n"; + key = "uw"; + action = ":lua ToggleWrap()"; + options = { + silent = true; + desc = "Toggle Line Wrap"; + }; + } + + { + mode = "v"; + key = "J"; + action = ":m '>+1gv=gv"; + options = { + silent = true; + desc = "Move up when line is highlighted"; + }; + } + + { + mode = "v"; + key = "K"; + action = ":m '<-2gv=gv"; + options = { + silent = true; + desc = "Move down when line is highlighted"; + }; + } + + { + mode = "n"; + key = "J"; + action = "mzJ`z"; + options = { + silent = true; + desc = "Allow cursor to stay in the same place after appeding to current line"; + }; + } + + { + mode = "v"; + key = "<"; + action = " + y or just y to have it just in vim + { + mode = ["n" "v"]; + key = "y"; + action = "\"+y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + { + mode = ["n" "v"]; + key = "Y"; + action = "\"+Y"; + options = { + desc = "Copy to system clipboard"; + }; + } + + # Delete to void register + { + mode = ["n" "v"]; + key = "D"; + action = "\"_d"; + options = { + desc = "Delete to void register"; + }; + } + + # instead of pressing esc just because + { + mode = "i"; + key = ""; + action = ""; + } + + { + mode = "n"; + key = ""; + action = "!tmux new tmux-sessionizer"; + options = { + desc = "Switch between projects"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + function ToggleLineNumber() + if vim.wo.number then + vim.wo.number = false + show_notification("Line numbers disabled", "info") + else + vim.wo.number = true + vim.wo.relativenumber = false + show_notification("Line numbers enabled", "info") + end + end + + function ToggleRelativeLineNumber() + if vim.wo.relativenumber then + vim.wo.relativenumber = false + show_notification("Relative line numbers disabled", "info") + else + vim.wo.relativenumber = true + vim.wo.number = false + show_notification("Relative line numbers enabled", "info") + end + end + + function ToggleWrap() + if vim.wo.wrap then + vim.wo.wrap = false + show_notification("Wrap disabled", "info") + else + vim.wo.wrap = true + vim.wo.number = false + show_notification("Wrap enabled", "info") + end + end + + if vim.lsp.inlay_hint then + vim.keymap.set('n', 'uh', function() + vim.lsp.inlay_hint(0, nil) + end, { desc = 'Toggle Inlay Hints' }) + end + ''; +} diff --git a/pkgs/nvim/config/languages/nvim-jdtls.nix b/pkgs/nvim/config/languages/nvim-jdtls.nix new file mode 100644 index 0000000..b3d4d0a --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-jdtls.nix @@ -0,0 +1,81 @@ +let + javaTestPath = "/nix/store/j3nvmhvj2pmnykw5pbm51dn0bz4cv6j3-vscode-extension-vscjava-vscode-java-test-0.38.2023032402/share/vscode/extensions/vscjava.vscode-java-test/server/com.microsoft.java.test.plugin-0.38.2.jar + "; +in { + plugins.nvim-jdtls = { + enable = true; + cmd = [ + "/nix/store/20h2hjjm94gbskqhbwikbgxbblv1xpf2-jdt-language-server-1.31.0/bin/jdtls" + ]; + # configuration = "/path/to/configuration"; + data = "~/.cache/jdtls/workspace"; + settings = { + java = { + signatureHelp = true; + completion = true; + }; + }; + initOptions = { + bundles = [ + "/nix/store/b9ib40q36wxjl4xs5lng263lflz1fsi7-vscode-extension-vscjava-vscode-java-debug-0.49.2023032407/share/vscode/extensions/vscjava.vscode-java-debug/server/com.microsoft.java.debug.plugin-0.44.0.jar" + "${javaTestPath}" + ]; + }; + }; +} +# +# extraConfigLua = '' +# local jdtls = require("jdtls") +# local cmp_nvim_lsp = require("cmp_nvim_lsp") +# +# local root_dir = require("jdtls.setup").find_root({ "packageInfo" }, "Config") +# local home = os.getenv("HOME") +# local eclipse_workspace = home .. "/.local/share/eclipse/" .. vim.fn.fnamemodify(root_dir, ":p:h:t") +# +# local ws_folders_jdtls = {} +# if root_dir then +# local file = io.open(root_dir .. "/.bemol/ws_root_folders") +# if file then +# for line in file:lines() do +# table.insert(ws_folders_jdtls, "file://" .. line) +# end +# file:close() +# end +# end +# +# -- for completions +# local client_capabilities = vim.lsp.protocol.make_client_capabilities() +# local capabilities = cmp_nvim_lsp.default_capabilities(client_capabilities) +# +# local config = { +# capabilities = capabilities, +# cmd = { +# "${pkgs.jdt-language-server}/bin/jdt-language-server", +# "--jvm-arg=-javaagent:" .. home .. "/Developer/lombok.jar", +# "-data", +# eclipse_workspace, +# "--add-modules=ALL-SYSTEM", +# }, +# root_dir = root_dir, +# init_options = { +# workspaceFolders = ws_folders_jdtls, +# }, +# settings = { +# java = { +# signatureHelp = { enabled = true}, +# completion = { enabled = true }, +# }, +# }, +# on_attach = function(client, bufnr) +# local opts = { silent = true, buffer = bufnr } +# vim.keymap.set('n', "lo", jdtls.organize_imports, { desc = 'Organize imports', buffer = bufnr }) +# vim.keymap.set('n', "df", jdtls.test_class, opts) +# vim.keymap.set('n', "dn", jdtls.test_nearest_method, opts) +# vim.keymap.set('n', 'rv', jdtls.extract_variable_all, { desc = 'Extract variable', buffer = bufnr }) +# vim.keymap.set('n', 'rc', jdtls.extract_constant, { desc = 'Extract constant', buffer = bufnr }) +# end +# } +# +# jdtls.start_or_attach(config) +# ''; + diff --git a/pkgs/nvim/config/languages/nvim-lint.nix b/pkgs/nvim/config/languages/nvim-lint.nix new file mode 100644 index 0000000..7876ddd --- /dev/null +++ b/pkgs/nvim/config/languages/nvim-lint.nix @@ -0,0 +1,20 @@ +{pkgs, ...}: { + plugins.lint = { + enable = true; + lintersByFt = { + nix = ["satix"]; + lua = ["selene"]; + python = ["flake8"]; + javascript = ["eslint_d"]; + javascriptreact = ["eslint_d"]; + typescript = ["eslint_d"]; + typescriptreact = ["eslint_d"]; + json = ["jsonlint"]; + java = ["checkstyle"]; + }; + }; + + extraPackages = with pkgs; [ + statix + ]; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-context.nix b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix new file mode 100644 index 0000000..b588c8f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-context.nix @@ -0,0 +1,5 @@ +{ + plugins.treesitter-context = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix new file mode 100644 index 0000000..29820cf --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter-textobjects.nix @@ -0,0 +1,50 @@ +{ + plugins.treesitter-textobjects = { + enable = false; + select = { + enable = true; + lookahead = true; + keymaps = { + "aa" = "@parameter.outer"; + "ia" = "@parameter.inner"; + "af" = "@function.outer"; + "if" = "@function.inner"; + "ac" = "@class.outer"; + "ic" = "@class.inner"; + "ii" = "@conditional.inner"; + "ai" = "@conditional.outer"; + "il" = "@loop.inner"; + "al" = "@loop.outer"; + "at" = "@comment.outer"; + }; + }; + move = { + enable = true; + gotoNextStart = { + "]m" = "@function.outer"; + "]]" = "@class.outer"; + }; + gotoNextEnd = { + "]M" = "@function.outer"; + "][" = "@class.outer"; + }; + gotoPreviousStart = { + "[m" = "@function.outer"; + "[[" = "@class.outer"; + }; + gotoPreviousEnd = { + "[M" = "@function.outer"; + "[]" = "@class.outer"; + }; + }; + swap = { + enable = true; + swapNext = { + "a" = "@parameters.inner"; + }; + swapPrevious = { + "A" = "@parameter.outer"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/treesitter.nix b/pkgs/nvim/config/languages/treesitter/treesitter.nix new file mode 100644 index 0000000..8ff420f --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/treesitter.nix @@ -0,0 +1,8 @@ +{ + plugins.treesitter = { + enable = true; + indent = true; + folding = true; + nixvimInjections = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-autotag.nix b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix new file mode 100644 index 0000000..9fa6d84 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-autotag.nix @@ -0,0 +1,5 @@ +{ + plugins.ts-autotag = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix new file mode 100644 index 0000000..aad1ce0 --- /dev/null +++ b/pkgs/nvim/config/languages/treesitter/ts-context-commentstring.nix @@ -0,0 +1,6 @@ +{ + plugins.ts-context-commentstring = { + enable = true; + disableAutoInitialization = false; + }; +} diff --git a/pkgs/nvim/config/languages/typescript-tools-nvim.nix b/pkgs/nvim/config/languages/typescript-tools-nvim.nix new file mode 100644 index 0000000..8134073 --- /dev/null +++ b/pkgs/nvim/config/languages/typescript-tools-nvim.nix @@ -0,0 +1,47 @@ +{ + plugins.typescript-tools = { + enable = true; + onAttach = '' + function(client, bufnr) + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + + if vim.lsp.inlay_hint then + vim.lsp.inlay_hint(bufnr, true) + end + end + ''; + settings = { + tsserverFilePreferences = { + # Inlay Hints + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayVariableTypeHints = true; + includeInlayVariableTypeHintsWhenTypeMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayEnumMemberValueHints = true; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "co"; + action = "TSToolsOrganizeImports"; + options = { + desc = "Organize Imports"; + }; + } + { + mode = "n"; + key = "cR"; + action = "TSToolsRemoveUnusedImports"; + options = { + desc = "Remove Unused Imports"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/conform.nix b/pkgs/nvim/config/lsp/conform.nix new file mode 100644 index 0000000..d252da6 --- /dev/null +++ b/pkgs/nvim/config/lsp/conform.nix @@ -0,0 +1,92 @@ +{ + plugins.conform-nvim = { + enable = true; + notifyOnError = true; + formattersByFt = { + html = [["prettierd" "prettier"]]; + css = [["prettierd" "prettier"]]; + javascript = [["prettierd" "prettier"]]; + javascriptreact = [["prettierd" "prettier"]]; + typescript = [["prettierd" "prettier"]]; + typescriptreact = [["prettierd" "prettier"]]; + java = ["google-java-format"]; + python = ["black"]; + lua = ["stylua"]; + nix = ["alejandra"]; + markdown = [["prettierd" "prettier"]]; + rust = ["rustfmt"]; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "uf"; + action = ":FormatToggle"; + options = { + desc = "Toggle Format"; + silent = true; + }; + } + { + mode = "n"; + key = "cf"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Buffer"; + }; + } + + { + mode = "v"; + key = "cF"; + action = "lua require('conform').format()"; + options = { + silent = true; + desc = "Format Lines"; + }; + } + ]; + + extraConfigLua = '' + local conform = require("conform") + local notify = require("notify") + + conform.setup({ + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { timeout_ms = 500, lsp_fallback = true } + end, + }) + + local function show_notification(message, level) + notify(message, level, { title = "conform.nvim" }) + end + + vim.api.nvim_create_user_command("FormatToggle", function(args) + local is_global = not args.bang + if is_global then + vim.g.disable_autoformat = not vim.g.disable_autoformat + if vim.g.disable_autoformat then + show_notification("Autoformat-on-save disabled globally", "info") + else + show_notification("Autoformat-on-save enabled globally", "info") + end + else + vim.b.disable_autoformat = not vim.b.disable_autoformat + if vim.b.disable_autoformat then + show_notification("Autoformat-on-save disabled for this buffer", "info") + else + show_notification("Autoformat-on-save enabled for this buffer", "info") + end + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; +} diff --git a/pkgs/nvim/config/lsp/fidget.nix b/pkgs/nvim/config/lsp/fidget.nix new file mode 100644 index 0000000..868f386 --- /dev/null +++ b/pkgs/nvim/config/lsp/fidget.nix @@ -0,0 +1,99 @@ +{ + plugins.fidget = { + enable = true; + logger = { + level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + floatPrecision = 0.01; # Limit the number of decimals displayed for floats + }; + progress = { + pollRate = 0; # How and when to poll for progress messages + suppressOnInsert = true; # Suppress new messages while in insert mode + ignoreDoneAlready = false; # Ignore new tasks that are already complete + ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message + clearOnDetach = + # Clear notification group when LSP server detaches + '' + function(client_id) + local client = vim.lsp.get_client_by_id(client_id) + return client and client.name or nil + end + ''; + notificationGroup = + # How to get a progress message's notification group key + '' + function(msg) return msg.lsp_client.name end + ''; + ignore = []; # List of LSP servers to ignore + lsp = { + progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size + }; + display = { + renderLimit = 16; # How many LSP messages to show at once + doneTtl = 3; # How long a message should persist after completion + doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete + doneStyle = "Constant"; # Highlight group for completed LSP tasks + progressTtl = "math.huge"; # How long a message should persist when in progress + progressIcon = { + pattern = "dots"; + period = 1; + }; # Icon shown when LSP progress tasks are in progress + progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks + groupStyle = "Title"; # Highlight group for group name (LSP server name) + iconStyle = "Question"; # Highlight group for group icons + priority = 30; # Ordering priority for LSP notification group + skipHistory = true; # Whether progress notifications should be omitted from history + formatMessage = '' + require ("fidget.progress.display").default_format_message + ''; # How to format a progress message + formatAnnote = '' + function (msg) return msg.title end + ''; # How to format a progress annotation + formatGroupName = '' + function (group) return tostring (group) end + ''; # How to format a progress notification group's name + overrides = { + rust_analyzer = { + name = "rust-analyzer"; + }; + }; # Override options from the default notification config + }; + }; + notification = { + pollRate = 10; # How frequently to update and render notifications + filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace” + historySize = 128; # Number of removed messages to retain in history + overrideVimNotify = true; + redirect = '' + function(msg, level, opts) + if opts and opts.on_open then + return require("fidget.integration.nvim-notify").delegate(msg, level, opts) + end + end + ''; + configs = { + default = "require('fidget.notification').default_config"; + }; + + window = { + normalHl = "Comment"; + winblend = 0; + border = "none"; # none, single, double, rounded, solid, shadow + zindex = 45; + maxWidth = 0; + maxHeight = 0; + xPadding = 1; + yPadding = 0; + align = "bottom"; + relative = "editor"; + }; + view = { + stackUpwards = true; # Display notification items from bottom to top + iconSeparator = " "; # Separator between group name and icon + groupSeparator = "---"; # Separator between notification groups + groupSeparatorHl = + # Highlight group used for group separator + "Comment"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/lsp/lsp.nix b/pkgs/nvim/config/lsp/lsp.nix new file mode 100644 index 0000000..4568642 --- /dev/null +++ b/pkgs/nvim/config/lsp/lsp.nix @@ -0,0 +1,167 @@ +{ + plugins = { + lsp-format = { + enable = false; # Enable it if you want lsp-format integration for none-ls + }; + lsp = { + enable = true; + capabilities = "offsetEncoding = 'utf-16'"; + servers = { + clangd = {enable = true;}; + lua-ls = { + enable = true; + extraOptions = { + settings = { + Lua = { + completion = { + callSnippet = "Replace"; + }; + telemetry = { + enabled = false; + }; + hint = {enable = true;}; + }; + }; + }; + }; + nil_ls = {enable = true;}; + tsserver = { + enable = false; + filetypes = ["javascript" "javascriptreact" "typescript" "typescriptreact"]; + extraOptions = { + settings = { + javascript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + typescript = { + inlayHints = { + includeInlayEnumMemberValueHints = true; + includeInlayFunctionLikeReturnTypeHints = true; + includeInlayFunctionParameterTypeHints = true; + includeInlayParameterNameHints = "all"; + includeInlayParameterNameHintsWhenArgumentMatchesName = true; + includeInlayPropertyDeclarationTypeHints = true; + includeInlayVariableTypeHints = true; + }; + }; + }; + }; + }; + eslint = {enable = true;}; + pyright = {enable = true;}; + ruff-lsp = {enable = true;}; + + rust-analyzer = { + enable = true; + installCargo = true; + installRustc = true; + settings = { + checkOnSave = true; + check = { + command = "clippy"; + }; + # inlayHints = { + # enable = true; + # showParameterNames = true; + # parameterHintsPrefix = "<- "; + # otherHintsPrefix = "=> "; + # }; + procMacro = { + enable = true; + }; + }; + }; + }; + # keymaps = { + # silent = true; + # lspBuf = { + # gd = { + # action = "definition"; + # desc = "Goto Definition"; + # }; + # gr = { + # action = "references"; + # desc = "Goto References"; + # }; + # gD = { + # action = "declaration"; + # desc = "Goto Declaration"; + # }; + # gI = { + # action = "implementation"; + # desc = "Goto Implementation"; + # }; + # gT = { + # action = "type_definition"; + # desc = "Type Definition"; + # }; + # K = { + # action = "hover"; + # desc = "Hover"; + # }; + # "cw" = { + # action = "workspace_symbol"; + # desc = "Workspace Symbol"; + # }; + # "cr" = { + # action = "rename"; + # desc = "Rename"; + # }; + # "ca" = { + # action = "code_action"; + # desc = "Code Action"; + # }; + # "" = { + # action = "signature_help"; + # desc = "Signature Help"; + # }; + # }; + # diagnostic = { + # "cd" = { + # action = "open_float"; + # desc = "Line Diagnostics"; + # }; + # "[d" = { + # action = "goto_next"; + # desc = "Next Diagnostic"; + # }; + # "]d" = { + # action = "goto_prev"; + # desc = "Previous Diagnostic"; + # }; + # }; + # }; + }; + }; + extraConfigLua = '' + local _border = "rounded" + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } + ) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } + ) + + vim.diagnostic.config{ + float={border=_border} + }; + + require('lspconfig.ui.windows').default_options = { + border = _border + } + ''; +} diff --git a/pkgs/nvim/config/lsp/lspsaga.nix b/pkgs/nvim/config/lsp/lspsaga.nix new file mode 100644 index 0000000..6fdf5d9 --- /dev/null +++ b/pkgs/nvim/config/lsp/lspsaga.nix @@ -0,0 +1,186 @@ +{ + plugins.lspsaga = { + enable = true; + beacon = { + enable = true; + }; + ui = { + border = "rounded"; # One of none, single, double, rounded, solid, shadow + codeAction = "💡"; # Can be any symbol you want 💡 + }; + hover = { + openCmd = "!floorp"; # Choose your browser + openLink = "gx"; + }; + diagnostic = { + borderFollow = true; + diagnosticOnlyCurrent = false; + showCodeAction = true; + }; + symbolInWinbar = { + enable = true; # Breadcrumbs + }; + codeAction = { + extendGitSigns = false; + showServerName = true; + onlyInCursor = true; + numShortcut = true; + keys = { + exec = ""; + quit = ["" "q"]; + }; + }; + lightbulb = { + enable = false; + sign = false; + virtualText = true; + }; + implement = { + enable = false; + }; + rename = { + autoSave = false; + keys = { + exec = ""; + quit = ["" ""]; + select = "x"; + }; + }; + outline = { + autoClose = true; + autoPreview = true; + closeAfterJump = true; + layout = "normal"; # normal or float + winPosition = "right"; # left or right + keys = { + jump = "e"; + quit = "q"; + toggleOrJump = "o"; + }; + }; + scrollPreview = { + scrollDown = ""; + scrollUp = ""; + }; + }; + keymaps = [ + { + mode = "n"; + key = "gd"; + action = "Lspsaga finder def"; + options = { + desc = "Goto Definition"; + silent = true; + }; + } + { + mode = "n"; + key = "gr"; + action = "Lspsaga finder ref"; + options = { + desc = "Goto References"; + silent = true; + }; + } + + # { + # mode = "n"; + # key = "gD"; + # action = "Lspsaga show_line_diagnostics"; + # options = { + # desc = "Goto Declaration"; + # silent = true; + # }; + # } + + { + mode = "n"; + key = "gI"; + action = "Lspsaga finder imp"; + options = { + desc = "Goto Implementation"; + silent = true; + }; + } + + { + mode = "n"; + key = "gT"; + action = "Lspsaga peek_type_definition"; + options = { + desc = "Type Definition"; + silent = true; + }; + } + + { + mode = "n"; + key = "K"; + action = "Lspsaga hover_doc"; + options = { + desc = "Hover"; + silent = true; + }; + } + + { + mode = "n"; + key = "cw"; + action = "Lspsaga outline"; + options = { + desc = "Outline"; + silent = true; + }; + } + + { + mode = "n"; + key = "cr"; + action = "Lspsaga rename"; + options = { + desc = "Rename"; + silent = true; + }; + } + + { + mode = "n"; + key = "ca"; + action = "Lspsaga code_action"; + options = { + desc = "Code Action"; + silent = true; + }; + } + + { + mode = "n"; + key = "cd"; + action = "Lspsaga show_line_diagnostics"; + options = { + desc = "Line Diagnostics"; + silent = true; + }; + } + + { + mode = "n"; + key = "[d"; + action = "Lspsaga diagnostic_jump_next"; + options = { + desc = "Next Diagnostic"; + silent = true; + }; + } + + { + mode = "n"; + key = "]d"; + action = "Lspsaga diagnostic_jump_prev"; + options = { + desc = "Previous Diagnostic"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/lsp/trouble.nix b/pkgs/nvim/config/lsp/trouble.nix new file mode 100644 index 0000000..783aa08 --- /dev/null +++ b/pkgs/nvim/config/lsp/trouble.nix @@ -0,0 +1,52 @@ +{ + plugins.trouble = { + enable = true; + settings = { + auto_close = true; + }; + }; + # TODO: Add keybinds to close trouble (q would be nice), rn I need to use :x to close it... + keymaps = [ + { + mode = "n"; + key = "x"; + action = "+diagnostics/quickfix"; + } + { + mode = "n"; + key = "xx"; + action = "TroubleToggle"; + options = { + silent = true; + desc = "Document Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xX"; + action = "TroubleToggle workspace_diagnostics"; + options = { + silent = true; + desc = "Workspace Diagnostics (Trouble)"; + }; + } + { + mode = "n"; + key = "xt"; + action = "TroubleToggle todo"; + options = { + silent = true; + desc = "Todo (Trouble)"; + }; + } + { + mode = "n"; + key = "xQ"; + action = "TodoQuickFix"; + options = { + silent = true; + desc = "Quickfix List (Trouble)"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/none-ls/none-ls.nix b/pkgs/nvim/config/none-ls/none-ls.nix new file mode 100644 index 0000000..5eaaf6d --- /dev/null +++ b/pkgs/nvim/config/none-ls/none-ls.nix @@ -0,0 +1,73 @@ +{ + plugins.none-ls = { + enable = false; + enableLspFormat = false; + updateInInsert = false; + onAttach = '' + function(client, bufnr) + if client.supports_method "textDocument/formatting" then + vim.api.nvim_clear_autocmds { group = augroup, buffer = bufnr } + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format { bufnr = bufnr } + end, + }) + end + end + ''; + sources = { + code_actions = { + gitsigns.enable = true; + statix.enable = true; + }; + diagnostics = { + checkstyle = { + enable = true; + }; + statix = { + enable = true; + }; + }; + formatting = { + alejandra = { + enable = true; + }; + prettier = { + enable = true; + withArgs = '' + { + extra_args = { "--no-semi", "--single-quote" }, + } + ''; + }; + google_java_format = { + enable = true; + }; + stylua = { + enable = true; + }; + black = { + enable = true; + withArgs = '' + { + extra_args = { "--fast" }, + } + ''; + }; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "v" ]; + # key = "cf"; + # action = "lua vim.lsp.buf.format()"; + # options = { + # silent = true; + # desc = "Format"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/sets.nix b/pkgs/nvim/config/sets.nix new file mode 100644 index 0000000..d50f286 --- /dev/null +++ b/pkgs/nvim/config/sets.nix @@ -0,0 +1,145 @@ +{ + pkgs, + lib, + config, + ... +}: { + config = { + opts = { + # Enable relative line numbers + number = true; + relativenumber = true; + + # Set tabs to 2 spaces + tabstop = 2; + softtabstop = 2; + showtabline = 2; + expandtab = true; + + # Enable auto indenting and set it to spaces + smartindent = true; + shiftwidth = 2; + + # Enable smart indenting (see https://stackoverflow.com/questions/1204149/smart-wrap-in-vim) + breakindent = true; + + # Enable incremental searching + hlsearch = true; + incsearch = true; + + # Enable text wrap + wrap = true; + + # Better splitting + splitbelow = true; + splitright = true; + + # Enable mouse mode + mouse = "a"; # Mouse + + # Enable ignorecase + smartcase for better searching + ignorecase = true; + smartcase = true; # Don't ignore case with capitals + grepprg = "rg --vimgrep"; + grepformat = "%f:%l:%c:%m"; + + # Decrease updatetime + updatetime = 50; # faster completion (4000ms default) + + # Set completeopt to have a better completion experience + completeopt = ["menuone" "noselect" "noinsert"]; # mostly just for cmp + + # Enable persistent undo history + swapfile = false; + backup = false; + undofile = true; + + # Enable 24-bit colors + termguicolors = true; + + # Enable the sign column to prevent the screen from jumping + signcolumn = "yes"; + + # Enable cursor line highlight + cursorline = true; # Highlight the line where the cursor is located + + # Set fold settings + # These options were reccommended by nvim-ufo + # See: https://github.com/kevinhwang91/nvim-ufo#minimal-configuration + foldcolumn = "0"; + foldlevel = 99; + foldlevelstart = 99; + foldenable = true; + + # Always keep 8 lines above/below cursor unless at start/end of file + scrolloff = 8; + + # Place a column line + colorcolumn = "80"; + + # Reduce which-key timeout to 10ms + timeoutlen = 10; + + # Set encoding type + encoding = "utf-8"; + fileencoding = "utf-8"; + + # Change cursor options + guicursor = [ + "n-v-c:block" # Normal, visual, command-line: block cursor + "i-ci-ve:block" # Insert, command-line insert, visual-exclude: vertical bar cursor with block cursor, use "ver25" for 25% width + "r-cr:hor20" # Replace, command-line replace: horizontal bar cursor with 20% height + "o:hor50" # Operator-pending: horizontal bar cursor with 50% height + "a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor" # All modes: blinking settings + "sm:block-blinkwait175-blinkoff150-blinkon175" # Showmatch: block cursor with specific blinking settings + ]; + + # Enable chars list + list = true; # Show invisible characters (tabs, eol, ...) + listchars = "eol:↲,tab:|->,lead:·,space: ,trail:•,extends:→,precedes:←,nbsp:␣"; + + # More space in the neovim command line for displaying messages + cmdheight = 2; + + # We don't need to see things like INSERT anymore + showmode = false; + + # Maximum number of items to show in the popup menu (0 means "use available screen space") + pumheight = 0; + + # Use conform-nvim for gq formatting. ('formatexpr' is set to vim.lsp.formatexpr(), so you can format lines via gq if the language server supports it) + formatexpr = "v:lua.require'conform'.formatexpr()"; + + laststatus = 3; # (https://neovim.io/doc/user/options.html#'laststatus') + }; + + extraConfigLua = '' + local opt = vim.opt + local g = vim.g + local o = vim.o + -- Neovide + if g.neovide then + -- Neovide options + g.neovide_fullscreen = false + g.neovide_hide_mouse_when_typing = false + g.neovide_refresh_rate = 165 + g.neovide_cursor_vfx_mode = "ripple" + g.neovide_cursor_animate_command_line = true + g.neovide_cursor_animate_in_insert_mode = true + g.neovide_cursor_vfx_particle_lifetime = 5.0 + g.neovide_cursor_vfx_particle_density = 14.0 + g.neovide_cursor_vfx_particle_speed = 12.0 + g.neovide_transparency = 0.8 + + -- Neovide Fonts + o.guifont = "MonoLisa Trial:Medium:h15" + -- o.guifont = "CommitMono:Medium:h15" + -- o.guifont = "JetBrainsMono Nerd Font:h14:Medium:i" + -- o.guifont = "FiraMono Nerd Font:Medium:h14" + -- o.guifont = "CaskaydiaCove Nerd Font:h14:b:i" + -- o.guifont = "BlexMono Nerd Font Mono:h14:Medium:i" + -- o.guifont = "Liga SFMono Nerd Font:b:h15" + end + ''; + }; +} diff --git a/pkgs/nvim/config/snippets/luasnip.nix b/pkgs/nvim/config/snippets/luasnip.nix new file mode 100644 index 0000000..02d9ee0 --- /dev/null +++ b/pkgs/nvim/config/snippets/luasnip.nix @@ -0,0 +1,19 @@ +{ + pkgs, + config, + ... +}: { + plugins.luasnip = { + enable = true; + extraConfig = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + }; +} diff --git a/pkgs/nvim/config/statusline/lualine.nix b/pkgs/nvim/config/statusline/lualine.nix new file mode 100644 index 0000000..1a2d424 --- /dev/null +++ b/pkgs/nvim/config/statusline/lualine.nix @@ -0,0 +1,33 @@ +{ + plugins.lualine = { + enable = false; + alwaysDivideMiddle = true; + globalstatus = true; + ignoreFocus = ["neo-tree"]; + extensions = ["fzf"]; + theme = "auto"; + componentSeparators = { + left = "|"; + right = "|"; + }; + sectionSeparators = { + left = "█"; #  + right = "█"; #  + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + name = "branch"; + icon = ""; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["filetype"]; + lualine_y = ["progress"]; + lualine_z = [''" " .. os.date("%R")'']; + }; + }; +} diff --git a/pkgs/nvim/config/statusline/staline.nix b/pkgs/nvim/config/statusline/staline.nix new file mode 100644 index 0000000..ae07bb8 --- /dev/null +++ b/pkgs/nvim/config/statusline/staline.nix @@ -0,0 +1,65 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "staline.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "tamton-aquib"; + repo = "staline.nvim"; + rev = "a53f869278b8b186a5afd6f21680cd103c381599"; + hash = "sha256-GDMKzxFDtQk5LL+rMsxTGTyLv69w5NUd+u19noeO5ws="; + }; + }) + ]; + extraConfigLua = '' + require("staline").setup({ + sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + inactive_sections = { + left = { "-mode", " ", "branch" }, + mid = { "lsp_name" }, + right = { "file_name", "line_column" }, + }, + defaults = { + left_separator = " ", + right_separator = " ", + branch_symbol = " ", + mod_symbol = "", + line_column = "[%l/%L]", + inactive_color = "#80a6f2", --#303030 is the default + inactive_bgcolor = "none", + }, + special_table = { + lazy = { "Plugins", "💤 " }, + TelescopePrompt = { "Telescope", " " }, + oil = { "Oil", "󰏇 " }, + lazygit = { "LazyGit", " " }, + }, + mode_icons = { + ["n"] = "NORMAL", + ["no"] = "NORMAL", + ["nov"] = "NORMAL", + ["noV"] = "NORMAL", + ["niI"] = "NORMAL", + ["niR"] = "NORMAL", + ["niV"] = "NORMAL", + ["i"] = "INSERT", + ["ic"] = "INSERT", + ["ix"] = "INSERT", + ["s"] = "INSERT", + ["S"] = "INSERT", + ["v"] = "VISUAL", + ["V"] = "VISUAL", + [""] = "VISUAL", + ["r"] = "REPLACE", + ["r?"] = "REPLACE", + ["R"] = "REPLACE", + ["c"] = "COMMAND", + ["t"] = "TERMINAL", + }, + }) + ''; +} diff --git a/pkgs/nvim/config/telescope/telescope.nix b/pkgs/nvim/config/telescope/telescope.nix new file mode 100644 index 0000000..19303aa --- /dev/null +++ b/pkgs/nvim/config/telescope/telescope.nix @@ -0,0 +1,178 @@ +{ + plugins.telescope = { + enable = true; + + extensions = { + fzf-native = { + enable = true; + }; + ui-select = { + settings = { + specific_opts = { + codeactions = true; + }; + }; + }; + undo = { + enable = true; + }; + }; + # If you'd prefer Telescope not to enter a normal-like mode when hitting escape (and instead exiting), you can map to do so via: + settings = { + defaults = { + mappings = { + i = { + "" = { + __raw = '' + function(...) + return require("telescope.actions").close(...) + end''; + }; + }; + }; + }; + }; + keymaps = { + "" = { + action = "find_files"; + options.desc = "Find project files"; + }; + "/" = { + action = "live_grep"; + options.desc = "Grep (root dir)"; + }; + ":" = { + action = "command_history"; + options.desc = "Command History"; + }; + "b" = { + action = "buffers"; + options.desc = "+buffer"; + }; + "ff" = { + action = "find_files"; + options.desc = "Find project files"; + }; + "fr" = { + action = "oldfiles"; + options.desc = "Recent"; + }; + "fb" = { + action = "buffers"; + options.desc = "Buffers"; + }; + "" = { + action = "git_files"; + options.desc = "Search git files"; + }; + "gc" = { + action = "git_commits"; + options.desc = "Commits"; + }; + "gs" = { + action = "git_status"; + options.desc = "Status"; + }; + "sa" = { + action = "autocommands"; + options.desc = "Auto Commands"; + }; + "sb" = { + action = "current_buffer_fuzzy_find"; + options.desc = "Buffer"; + }; + "sc" = { + action = "command_history"; + options.desc = "Command History"; + }; + "sC" = { + action = "commands"; + options.desc = "Commands"; + }; + "sD" = { + action = "diagnostics"; + options.desc = "Workspace diagnostics"; + }; + "sh" = { + action = "help_tags"; + options.desc = "Help pages"; + }; + "sH" = { + action = "highlights"; + options.desc = "Search Highlight Groups"; + }; + "sk" = { + action = "keymaps"; + options.desc = "Keymaps"; + }; + "sM" = { + action = "man_pages"; + options.desc = "Man pages"; + }; + "sm" = { + action = "marks"; + options.desc = "Jump to Mark"; + }; + "so" = { + action = "vim_options"; + options.desc = "Options"; + }; + "sR" = { + action = "resume"; + options.desc = "Resume"; + }; + "uC" = { + action = "colorscheme"; + options.desc = "Colorscheme preview"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "fp"; + action = "Telescope projects"; + options = { + desc = "Projects"; + }; + } + + { + mode = "n"; + key = "sd"; + action = "Telescope diagnostics bufnr=0"; + options = { + desc = "Document diagnostics"; + }; + } + + { + mode = "n"; + key = "st"; + action = "TodoTelescope"; + options = { + silent = true; + desc = "Todo (Telescope)"; + }; + } + + # { + # mode = "n"; + # key = ","; + # action = "Telescope buffers sort_mru=true sort_lastused=true"; + # options = { + # desc = "Switch Buffer"; + # }; + # } + ]; + extraConfigLua = '' + local telescope = require('telescope') + telescope.setup{ + pickers = { + colorscheme = { + enable_preview = true + } + } + } + ''; +} diff --git a/pkgs/nvim/config/ui/alpha.nix b/pkgs/nvim/config/ui/alpha.nix new file mode 100644 index 0000000..69658ae --- /dev/null +++ b/pkgs/nvim/config/ui/alpha.nix @@ -0,0 +1,191 @@ +{ + plugins.alpha = { + enable = true; + theme = null; + iconsEnabled = true; + layout = let + padding = val: { + type = "padding"; + inherit val; + }; + in [ + (padding 4) + { + opts = { + hl = "AlphaHeader"; + position = "center"; + }; + type = "text"; + val = [ + " ██▀███ ▓█████ ▓█████▄▓██ ██▓ █████▒ " + " ▓██ ▒ ██▒▓█ ▀ ▒██▀ ██▌▒██ ██▒▓██ ▒ " + " ▓██ ░▄█ ▒▒███ ░██ █▌ ▒██ ██░▒████ ░ " + " ▒██▀▀█▄ ▒▓█ ▄ ░▓█▄ ▌ ░ ▐██▓░░▓█▒ ░ " + " ░██▓ ▒██▒░▒████▒░▒████▓ ░ ██▒▓░░▒█░ " + " ░ ▒▓ ░▒▓░░░ ▒░ ░ ▒▒▓ ▒ ██▒▒▒ ▒ ░ " + " ░▒ ░ ▒░ ░ ░ ░ ░ ▒ ▒ ▓██ ░▒░ ░ " + " ░░ ░ ░ ░ ░ ░ ▒ ▒ ░░ ░ ░ " + " ░ ░ ░ ░ ░ ░ " + " " + " git@github.com:redyf " + ]; + } + (padding 2) + { + type = "button"; + val = " Find File"; + on_press.raw = "require('telescope.builtin').find_files"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "f" + ":Telescope find_files " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "f"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " New File"; + on_press.__raw = "function() vim.cmd[[ene]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "n" + ":ene startinsert " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "n"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈚 Recent Files"; + on_press.raw = "require('telescope.builtin').oldfiles"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "r" + ":Telescope oldfiles " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "r"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = "󰈭 Find Word"; + on_press.raw = "require('telescope.builtin').live_grep"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "g" + ":Telescope live_grep " + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "g"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Restore Session"; + on_press.raw = "require('persistence').load()"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "s" + ":lua require('persistence').load()" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "s"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + (padding 1) + { + type = "button"; + val = " Quit Neovim"; + on_press.__raw = "function() vim.cmd[[qa]] end"; + opts = { + # hl = "comment"; + keymap = [ + "n" + "q" + ":qa" + { + noremap = true; + silent = true; + nowait = true; + } + ]; + shortcut = "q"; + + position = "center"; + cursor = 3; + width = 38; + align_shortcut = "right"; + hl_shortcut = "Keyword"; + }; + } + ]; + }; +} diff --git a/pkgs/nvim/config/ui/dressing-nvim.nix b/pkgs/nvim/config/ui/dressing-nvim.nix new file mode 100644 index 0000000..9f4374b --- /dev/null +++ b/pkgs/nvim/config/ui/dressing-nvim.nix @@ -0,0 +1,171 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + dressing-nvim + ]; + extraConfigLua = '' + require("dressing").setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "Input", + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Can be 'left', 'right', or 'center' + title_pos = "left", + + -- When true, will close the modal + insert_only = true, + + -- When true, input will start in insert mode. + start_in_insert = true, + + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + + buf_options = {}, + win_options = { + -- Disable line wrapping + wrap = false, + -- Indicator for when text exceeds window + list = true, + listchars = "precedes:…,extends:…", + -- Increase this for more context when text scrolls off the window + sidescrolloff = 0, + }, + + -- Set to `false` to disable + mappings = { + n = { + [""] = "Close", + [""] = "Confirm", + }, + i = { + [""] = "Close", + [""] = "Confirm", + [""] = "HistoryPrev", + [""] = "HistoryNext", + }, + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Trim trailing `:` from prompt + trim_prompt = true, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + telescope = nil, + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf-lua + fzf_lua = { + -- winopts = { + -- height = 0.5, + -- width = 0.5, + -- }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + buf_options = { + swapfile = false, + filetype = "DressingSelect", + }, + win_options = { + winblend = 0, + }, + max_width = 80, + max_height = 40, + min_width = 40, + min_height = 10, + }, + + -- Options for built-in selector + builtin = { + -- Display numbers for options and set up keymaps + show_numbers = true, + -- These are passed to nvim_open_win + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + buf_options = {}, + win_options = { + cursorline = true, + cursorlineopt = "both", + }, + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + -- Set to `false` to disable + mappings = { + [""] = "Close", + [""] = "Close", + [""] = "Confirm", + }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, + }) ''; +} diff --git a/pkgs/nvim/config/ui/indent-blankline.nix b/pkgs/nvim/config/ui/indent-blankline.nix new file mode 100644 index 0000000..1c382c8 --- /dev/null +++ b/pkgs/nvim/config/ui/indent-blankline.nix @@ -0,0 +1,32 @@ +{ + plugins = { + indent-blankline = { + enable = true; + settings = { + indent = { + char = "│"; # "│" or "▎" + }; + scope = { + enabled = true; + show_start = true; + }; + exclude = { + buftypes = ["terminal" "nofile"]; + filetypes = [ + "help" + "alpha" + "dashboard" + "neo-tree" + "Trouble" + "trouble" + "lazy" + "mason" + "notify" + "toggleterm" + "lazyterm" + ]; + }; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/noice.nix b/pkgs/nvim/config/ui/noice.nix new file mode 100644 index 0000000..51db89d --- /dev/null +++ b/pkgs/nvim/config/ui/noice.nix @@ -0,0 +1,36 @@ +{ + plugins.noice = { + enable = true; + notify = { + enabled = false; + }; + messages = { + enabled = true; # Adds a padding-bottom to neovim statusline when set to false for some reason + }; + lsp = { + message = { + enabled = true; + }; + progress = { + enabled = false; + view = "mini"; + }; + }; + popupmenu = { + enabled = true; + backend = "nui"; + }; + format = { + filter = { + pattern = [":%s*%%s*s:%s*" ":%s*%%s*s!%s*" ":%s*%%s*s/%s*" "%s*s:%s*" ":%s*s!%s*" ":%s*s/%s*"]; + icon = ""; + lang = "regex"; + }; + replace = { + pattern = [":%s*%%s*s:%w*:%s*" ":%s*%%s*s!%w*!%s*" ":%s*%%s*s/%w*/%s*" "%s*s:%w*:%s*" ":%s*s!%w*!%s*" ":%s*s/%w*/%s*"]; + icon = "󱞪"; + lang = "regex"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/ui/nui.nix b/pkgs/nvim/config/ui/nui.nix new file mode 100644 index 0000000..f2710a3 --- /dev/null +++ b/pkgs/nvim/config/ui/nui.nix @@ -0,0 +1,3 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [nui-nvim]; +} diff --git a/pkgs/nvim/config/ui/nvim-notify.nix b/pkgs/nvim/config/ui/nvim-notify.nix new file mode 100644 index 0000000..30441ce --- /dev/null +++ b/pkgs/nvim/config/ui/nvim-notify.nix @@ -0,0 +1,44 @@ +{ + plugins.notify = { + enable = true; + backgroundColour = "#000000"; + fps = 60; + render = "default"; + timeout = 500; + topDown = true; + }; + keymaps = [ + { + mode = "n"; + key = "un"; + action = '' + lua require("notify").dismiss({ silent = true, pending = true }) + ''; + options = { + desc = "Dismiss All Notifications"; + }; + } + ]; + extraConfigLua = '' + local notify = require("notify") + local filtered_message = { "No information available" } + + -- Override notify function to filter out messages + ---@diagnostic disable-next-line: duplicate-set-field + vim.notify = function(message, level, opts) + local merged_opts = vim.tbl_extend("force", { + on_open = function(win) + local buf = vim.api.nvim_win_get_buf(win) + vim.api.nvim_buf_set_option(buf, "filetype", "markdown") + end, + }, opts or {}) + + for _, msg in ipairs(filtered_message) do + if message == msg then + return + end + end + return notify(message, level, merged_opts) + end + ''; +} diff --git a/pkgs/nvim/config/utils/better-escape.nix b/pkgs/nvim/config/utils/better-escape.nix new file mode 100644 index 0000000..22b136c --- /dev/null +++ b/pkgs/nvim/config/utils/better-escape.nix @@ -0,0 +1,7 @@ +{ + plugins.better-escape = { + enable = true; + clearEmptyLines = true; + timeout = 200; + }; +} diff --git a/pkgs/nvim/config/utils/flash.nix b/pkgs/nvim/config/utils/flash.nix new file mode 100644 index 0000000..b531743 --- /dev/null +++ b/pkgs/nvim/config/utils/flash.nix @@ -0,0 +1,56 @@ +{ + plugins.flash = { + enable = false; + labels = "asdfghjklqwertyuiopzxcvbnm"; + search = { + mode = "fuzzy"; + }; + jump = { + autojump = true; + }; + label = { + uppercase = false; + rainbow = { + enabled = false; + shade = 5; + }; + }; + }; + # keymaps = [ + # { + # mode = [ "n" "x" "o" ]; + # key = "s"; + # action = "lua require('flash').jump()"; + # options = { + # desc = "Flash"; + # }; + # } + # + # { + # mode = [ "n" "x" "o" ]; + # key = "S"; + # action = "lua require('flash').treesitter()"; + # options = { + # desc = "Flash Treesitter"; + # }; + # } + # + # { + # mode = "o"; + # key = "r"; + # action = "lua require('flash').remote()"; + # options = { + # desc = "Remote Flash"; + # }; + # } + # + # { + # mode = [ "x" "o" ]; + # key = "R"; + # action = "lua require('flash').treesitter_search()"; + # options = { + # desc = "Treesitter Search"; + # }; + # } + # ]; +} diff --git a/pkgs/nvim/config/utils/hardtime.nix b/pkgs/nvim/config/utils/hardtime.nix new file mode 100644 index 0000000..e4bfef4 --- /dev/null +++ b/pkgs/nvim/config/utils/hardtime.nix @@ -0,0 +1,26 @@ +{ + plugins.hardtime = { + enable = true; + enabled = false; + disableMouse = true; + disabledFiletypes = ["neo-tree" "qf" "netrw" "NvimTree"]; + hint = true; + maxCount = 4; + maxTime = 1000; + restrictionMode = "hint"; + restrictedKeys = { + "h" = ["n" "x"]; + "j" = ["n" "x"]; + "k" = ["n" "x"]; + "l" = ["n" "x"]; + "-" = ["n" "x"]; + "+" = ["n" "x"]; + "gj" = ["n" "x"]; + "gk" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + "" = ["n" "x"]; + }; + }; +} diff --git a/pkgs/nvim/config/utils/harpoon.nix b/pkgs/nvim/config/utils/harpoon.nix new file mode 100644 index 0000000..b55df68 --- /dev/null +++ b/pkgs/nvim/config/utils/harpoon.nix @@ -0,0 +1,17 @@ +{ + plugins.harpoon = { + enable = true; + enableTelescope = true; + keymapsSilent = true; + keymaps = { + addFile = "ha"; + toggleQuickMenu = ""; + navFile = { + "1" = "hj"; + "2" = "hk"; + "3" = "hl"; + "4" = "hm"; + }; + }; + }; +} diff --git a/pkgs/nvim/config/utils/illuminate.nix b/pkgs/nvim/config/utils/illuminate.nix new file mode 100644 index 0000000..c05bc15 --- /dev/null +++ b/pkgs/nvim/config/utils/illuminate.nix @@ -0,0 +1,17 @@ +{ + plugins.illuminate = { + enable = false; + underCursor = false; + filetypesDenylist = [ + "DressingSelect" + "Outline" + "TelescopePrompt" + "alpha" + "harpoon" + "toggleterm" + "neo-tree" + "Spectre" + "reason" + ]; + }; +} diff --git a/pkgs/nvim/config/utils/markdown-preview.nix b/pkgs/nvim/config/utils/markdown-preview.nix new file mode 100644 index 0000000..00df5e6 --- /dev/null +++ b/pkgs/nvim/config/utils/markdown-preview.nix @@ -0,0 +1,19 @@ +{ + plugins.markdown-preview = { + enable = true; + settings = { + browser = "floorp"; + theme = "dark"; + }; + }; + keymaps = [ + { + mode = "n"; + key = "cp"; + action = "MarkdownPreview"; + options = { + desc = "Markdown Preview"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/mini.nix b/pkgs/nvim/config/utils/mini.nix new file mode 100644 index 0000000..f688f3f --- /dev/null +++ b/pkgs/nvim/config/utils/mini.nix @@ -0,0 +1,15 @@ +{ + plugins.mini = { + enable = true; + modules = { + comment = { + options = { + customCommentString = '' + lua require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + ''; + }; + }; + cursorword = {}; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neocord.nix b/pkgs/nvim/config/utils/neocord.nix new file mode 100644 index 0000000..2886367 --- /dev/null +++ b/pkgs/nvim/config/utils/neocord.nix @@ -0,0 +1,27 @@ +{ + plugins.neocord = { + enable = true; + settings = { + auto_update = true; + blacklist = []; + client_id = "1157438221865717891"; + debounce_timeout = 10; + editing_text = "Editing..."; + enable_line_number = true; + logo = "https://repository-images.githubusercontent.com/325421844/ecb73f47-cb89-4ee0-a0fd-9743c2f3569a"; + logo_tooltip = "NixVim"; + file_assets = null; + file_explorer_text = "Browsing..."; + git_commit_text = "Committing changes..."; + global_timer = true; + line_number_text = "Line %s out of %s"; + log_level = null; + main_image = "logo"; + plugin_manager_text = "Managing plugins..."; + reading_text = "Reading..."; + show_time = true; + terminal_text = "Using Terminal..."; + workspace_text = "Working on %s"; + }; + }; +} diff --git a/pkgs/nvim/config/utils/neodev.nix b/pkgs/nvim/config/utils/neodev.nix new file mode 100644 index 0000000..fa1619e --- /dev/null +++ b/pkgs/nvim/config/utils/neodev.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + neodev-nvim + ]; + + extraConfigLua = '' + require("neodev").setup({ + library = { plugins = {"neotest"}, types = true}, + }) + ''; +} diff --git a/pkgs/nvim/config/utils/neotest.nix b/pkgs/nvim/config/utils/neotest.nix new file mode 100644 index 0000000..5d25bcf --- /dev/null +++ b/pkgs/nvim/config/utils/neotest.nix @@ -0,0 +1,133 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-java"; + version = "v0.9.0"; + src = pkgs.fetchFromGitHub { + owner = "rcasia"; + repo = "neotest-java"; + rev = "2234bfa8044dc39a8baf90470747c65e4623a222"; + sha256 = "0w5fvqic3qapi9ggfb81nqa9fl6jv831s91r0wgn4d7c35h0340r"; + }; + }) + (pkgs.vimUtils.buildVimPlugin { + pname = "neotest-vim-test"; + version = "2023-04-17"; + src = pkgs.fetchFromGitHub { + owner = "nvim-neotest"; + repo = "neotest-vim-test"; + rev = "75c4228882ae4883b11bfce9b8383e637eb44192"; + sha256 = "12ix1lzmqlk3iyngaafby9c02fcl9d5iva965miwxfljvmibjnbw"; + }; + }) + neotest + FixCursorHold-nvim + neotest-plenary + vim-test + neotest-python + neotest-vitest + ]; + extraConfigLua = '' + require("neotest").setup({ + adapters = { + require("neotest-java")({ + ignore_wrapper = false, + -- function to determine which runner to use based on project path + determine_runner = function(project_root_path) + -- return should be "maven" or "gradle" + return "maven" + end, + -- override the builtin runner discovery behaviour to always use given + -- tool. Default is "nil", so no override + force_runner = nil, + -- if the automatic runner discovery can't uniquely determine whether + -- to use Gradle or Maven, fallback to using this runner. Default is + -- "maven" + fallback_runner = "gradle" + }), + require("neotest-python")({ + dap = { justMyCode = false }, + }), + require "neotest-vim-test" { + ignore_file_types = { "python", "java", "vim", "lua", "javascript", "typescript" }, + }, + }, + output = { enabled = true, open_on_run = true }, + summary = { enabled = true, }, + }) + ''; + keymaps = [ + { + mode = "n"; + key = "tt"; + action = "lua require('neotest').run.run(vim.fn.expand '%')"; + options = { + desc = "Run File"; + silent = true; + }; + } + { + mode = "n"; + key = "tT"; + action = "lua require('neotest').run.run(vim.loop.cwd())"; + options = { + desc = "Run All Test Files"; + silent = true; + }; + } + { + mode = "n"; + key = "tr"; + action = "lua require('neotest').run.run()"; + options = { + desc = "Run Nearest"; + silent = true; + }; + } + { + mode = "n"; + key = "td"; + action = "lua require('neotest').run.run({strategy = 'dap'})"; + options = { + desc = "Run Nearest with debugger"; + silent = true; + }; + } + { + mode = "n"; + key = "ts"; + action = "lua require('neotest').summary.toggle()"; + options = { + desc = "Toggle Summary"; + silent = true; + }; + } + { + mode = "n"; + key = "to"; + action = "lua require('neotest').output.open{ enter = true, auto_close = true }"; + options = { + desc = "Show Output"; + silent = true; + }; + } + { + mode = "n"; + key = "tO"; + action = "lua require('neotest').output_panel.toggle()"; + options = { + desc = "Toggle Output Panel"; + silent = true; + }; + } + { + mode = "n"; + key = "tS"; + action = "lua require('neotest').run.stop()"; + options = { + desc = "Stop"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/nvim-autopairs.nix b/pkgs/nvim/config/utils/nvim-autopairs.nix new file mode 100644 index 0000000..2af29dc --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-autopairs.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-autopairs = { + enable = false; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-colorizer.nix b/pkgs/nvim/config/utils/nvim-colorizer.nix new file mode 100644 index 0000000..81d8592 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-colorizer.nix @@ -0,0 +1,5 @@ +{ + plugins.nvim-colorizer = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/nvim-surround.nix b/pkgs/nvim/config/utils/nvim-surround.nix new file mode 100644 index 0000000..6a7f4b1 --- /dev/null +++ b/pkgs/nvim/config/utils/nvim-surround.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + nvim-surround + ]; + + extraConfigLua = '' + require("nvim-surround").setup() + ''; +} diff --git a/pkgs/nvim/config/utils/oil.nix b/pkgs/nvim/config/utils/oil.nix new file mode 100644 index 0000000..30a093c --- /dev/null +++ b/pkgs/nvim/config/utils/oil.nix @@ -0,0 +1,54 @@ +{ + plugins.oil = { + enable = true; + settings = { + useDefaultKeymaps = true; + deleteToTrash = true; + viewOptions = { + showHidden = true; + }; + preview = { + border = "rounded"; + }; + + float = { + padding = 2; + maxWidth = 0; # ''math.ceil(vim.o.lines * 0.8 - 4)''; + maxHeight = 0; # ''math.ceil(vim.o.columns * 0.8)''; + border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + winOptions = { + winblend = 0; + }; + }; + keymaps = { + "g?" = "actions.show_help"; + "" = "actions.select"; + "" = "actions.select_vsplit"; + "" = "actions.select_split"; # this is used to navigate left + "" = "actions.select_tab"; + "" = "actions.preview"; + "" = "actions.close"; + "" = "actions.refresh"; + "-" = "actions.parent"; + "_" = "actions.open_cwd"; + "`" = "actions.cd"; + "~" = "actions.tcd"; + "gs" = "actions.change_sort"; + "gx" = "actions.open_external"; + "g." = "actions.toggle_hidden"; + "q" = "actions.close"; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "o"; + action = ":Oil --float"; + options = { + desc = "Open parent directory"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/persistence.nix b/pkgs/nvim/config/utils/persistence.nix new file mode 100644 index 0000000..eb7cde3 --- /dev/null +++ b/pkgs/nvim/config/utils/persistence.nix @@ -0,0 +1,5 @@ +{ + plugins.persistence = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/plenary.nix b/pkgs/nvim/config/utils/plenary.nix new file mode 100644 index 0000000..133b26f --- /dev/null +++ b/pkgs/nvim/config/utils/plenary.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + plenary-nvim + ]; +} diff --git a/pkgs/nvim/config/utils/project-nvim.nix b/pkgs/nvim/config/utils/project-nvim.nix new file mode 100644 index 0000000..b411ec7 --- /dev/null +++ b/pkgs/nvim/config/utils/project-nvim.nix @@ -0,0 +1,6 @@ +{ + plugins.project-nvim = { + enable = true; + enableTelescope = true; + }; +} diff --git a/pkgs/nvim/config/utils/sidebar.nix b/pkgs/nvim/config/utils/sidebar.nix new file mode 100644 index 0000000..0cc4316 --- /dev/null +++ b/pkgs/nvim/config/utils/sidebar.nix @@ -0,0 +1,55 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "sidebar.nvim"; + version = "2024-02-07"; + src = pkgs.fetchFromGitHub { + owner = "sidebar-nvim"; + repo = "sidebar.nvim"; + rev = "5695712eef6288fff667343c4ae77c54911bdb1b"; + sha256 = "1p12189367x0x26cys9wxipzwr3i0bmz4lb0s79ki0a49d6zja2c"; + }; + }) + ]; + extraConfigLua = '' + local sidebar = require("sidebar-nvim") + sidebar.setup({ + disable_default_keybindings = 0, + bindings = nil, + open = false, + side = "left", + initial_width = 32, + hide_statusline = false, + update_interval = 1000, + sections = { "git", "containers" }, + section_separator = {"", "-----", ""}, + section_title_separator = {""}, + containers = { + attach_shell = "/bin/sh", show_all = true, interval = 5000, + }, + datetime = { format = "%a %b %d, %H:%M", clocks = { { name = "local" } } }, + todos = { ignored_paths = {} }, + ["git"] = { + icon = "", --  + }, + }) + cmd = { + "SidebarNvimToggle", + "SidebarNvimOpen", + "SidebarNvimFocus", + "SidebarNvimUpdate", + }, + ''; + + keymaps = [ + { + mode = "n"; + key = "e"; + action = ":SidebarNvimToggle"; + options = { + desc = "Toggle Explorer"; + silent = true; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/tmux-navigator.nix b/pkgs/nvim/config/utils/tmux-navigator.nix new file mode 100644 index 0000000..efb21c3 --- /dev/null +++ b/pkgs/nvim/config/utils/tmux-navigator.nix @@ -0,0 +1,5 @@ +{ + plugins.tmux-navigator = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/todo-comments.nix b/pkgs/nvim/config/utils/todo-comments.nix new file mode 100644 index 0000000..96878bb --- /dev/null +++ b/pkgs/nvim/config/utils/todo-comments.nix @@ -0,0 +1,5 @@ +{ + plugins.todo-comments = { + enable = true; + }; +} diff --git a/pkgs/nvim/config/utils/toggleterm.nix b/pkgs/nvim/config/utils/toggleterm.nix new file mode 100644 index 0000000..f9e23f8 --- /dev/null +++ b/pkgs/nvim/config/utils/toggleterm.nix @@ -0,0 +1,57 @@ +{ + plugins.toggleterm = { + enable = true; + settings = { + size = '' + function(term) + if term.direction == "horizontal" then + return 15 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end + ''; + open_mapping = "[[]]"; + hide_numbers = true; + shade_terminals = true; + start_in_insert = true; + terminal_mappings = true; + persist_mode = true; + insert_mappings = true; + close_on_exit = true; + shell = "zsh"; + direction = "float"; # 'vertical' | 'horizontal' | 'window' | 'float' + auto_scroll = true; + float_opts = { + border = "single"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open + width = 80; + height = 20; + winblend = 0; + }; + winbar = { + enabled = true; + name_formatter = '' + function(term) + return term.name + end + ''; + }; + }; + }; + + # extraConfigLua = '' + # function _G.set_terminal_keymaps() + # local opts = { buffer = 0 } + # vim.keymap.set("t", "", [[]], opts) + # vim.keymap.set("t", "jk", [[]], opts) + # vim.keymap.set("t", "", [[wincmd h]], opts) + # vim.keymap.set("t", "", [[wincmd j]], opts) + # vim.keymap.set("t", "", [[wincmd k]], opts) + # vim.keymap.set("t", "", [[wincmd l]], opts) + # vim.keymap.set("t", "", [[]], opts) + # end + # + # -- if you only want these mappings for toggle term use term://*toggleterm#* instead + # -- vim.cmd("autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()") + # ''; +} diff --git a/pkgs/nvim/config/utils/ultimate-autopair.nix b/pkgs/nvim/config/utils/ultimate-autopair.nix new file mode 100644 index 0000000..5730e45 --- /dev/null +++ b/pkgs/nvim/config/utils/ultimate-autopair.nix @@ -0,0 +1,17 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimUtils; [ + (buildVimPlugin { + pname = "ultimate-autopair.nvim"; + version = "2024-02-05"; + src = pkgs.fetchFromGitHub { + owner = "altermo"; + repo = "ultimate-autopair.nvim"; + rev = "25c13e0ce167db0255456cac10158b27d2be30c0"; + sha256 = "0bsxfj6g8fii9nn92vl15hdhafx3fikgiz4srr7y10pxz01c5s4c"; + }; + }) + ]; + extraConfigLua = '' + require('ultimate-autopair').setup() + ''; +} diff --git a/pkgs/nvim/config/utils/undotree.nix b/pkgs/nvim/config/utils/undotree.nix new file mode 100644 index 0000000..6232412 --- /dev/null +++ b/pkgs/nvim/config/utils/undotree.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + host, + user, + ... +}: { + plugins.undotree = { + enable = true; + settings = { + autoOpenDiff = true; + focusOnToggle = true; + }; + }; + keymaps = [ + { + mode = "n"; + key = "ut"; + action = "UndotreeToggle"; + options = { + silent = true; + desc = "Undotree"; + }; + } + ]; +} diff --git a/pkgs/nvim/config/utils/vim-be-good.nix b/pkgs/nvim/config/utils/vim-be-good.nix new file mode 100644 index 0000000..39292ae --- /dev/null +++ b/pkgs/nvim/config/utils/vim-be-good.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-be-good + ]; +} diff --git a/pkgs/nvim/config/utils/wakatime.nix b/pkgs/nvim/config/utils/wakatime.nix new file mode 100644 index 0000000..a007b47 --- /dev/null +++ b/pkgs/nvim/config/utils/wakatime.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: { + extraPlugins = with pkgs.vimPlugins; [ + vim-wakatime + ]; +} diff --git a/pkgs/nvim/config/utils/whichkey.nix b/pkgs/nvim/config/utils/whichkey.nix new file mode 100644 index 0000000..3b01821 --- /dev/null +++ b/pkgs/nvim/config/utils/whichkey.nix @@ -0,0 +1,19 @@ +{ + # TODO: Implement general mappings + plugins.which-key = { + enable = true; + ignoreMissing = false; + icons = { + breadcrumb = "»"; + group = "+"; + separator = ""; # ➜ + }; + # registrations = { + # "t" = " Terminal"; + # }; + window = { + border = "none"; + winblend = 0; + }; + }; +} diff --git a/pkgs/nvim/config/utils/wilder.nix b/pkgs/nvim/config/utils/wilder.nix new file mode 100644 index 0000000..a816ea0 --- /dev/null +++ b/pkgs/nvim/config/utils/wilder.nix @@ -0,0 +1,43 @@ +{ + plugins.wilder = { + enable = true; + modes = [":" "/" "?"]; + pipeline = [ + '' + wilder.branch( + wilder.python_file_finder_pipeline({ + file_command = function(ctx, arg) + if string.find(arg, '.') ~= nil then + return {'fd', '-tf', '-H'} + else + return {'fd', '-tf'} + end + end, + dir_command = {'fd', '-td'}, + filters = {'cpsm_filter'}, + }), + wilder.substitute_pipeline({ + pipeline = wilder.python_search_pipeline({ + skip_cmdtype_check = 1, + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }), + }), + wilder.cmdline_pipeline({ + language = 'python', + fuzzy = 1, + }), + { + wilder.check(function(ctx, x) return x == "" end), + wilder.history(), + }, + wilder.python_search_pipeline({ + pattern = wilder.python_fuzzy_pattern({ + start_at_boundary = 0, + }), + }) + ) '' + ]; + }; +} diff --git a/pkgs/nvim/default.nix b/pkgs/nvim/default.nix new file mode 100644 index 0000000..2efe8c6 --- /dev/null +++ b/pkgs/nvim/default.nix @@ -0,0 +1,13 @@ +{ + pkgs, + inputs, + ... +}: let + system = pkgs.system; + nixvim = inputs.nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; + extraSpecialArgs = {}; + }; +in (nixvim.makeNixvimWithModule nixvimModule) diff --git a/user/environments/mac/home.nix b/user/environments/mac/home.nix index c6b9f65..ce62093 100644 --- a/user/environments/mac/home.nix +++ b/user/environments/mac/home.nix @@ -6,7 +6,6 @@ ../../modules/zsh.nix ../../modules/zellij ../../modules/dev.nix - ../../modules/emacs.nix ../../modules/git.nix ../../modules/fonts.nix ../../modules/latex.nix diff --git a/user/modules/applications/alacritty.nix b/user/modules/applications/alacritty.nix index e24e878..1a7b6f8 100644 --- a/user/modules/applications/alacritty.nix +++ b/user/modules/applications/alacritty.nix @@ -4,6 +4,7 @@ settings = { window = { decorations = "Buttonless"; + option_as_alt = "OnlyLeft"; }; font = { size = 14; @@ -16,11 +17,11 @@ italic.style = "Extended Italic"; bold_italic.style = "Extended Bold Italic"; }; - key_bindings = [ + keyboard.bindings = [ { key = "Slash"; mods = "Control"; - chars = "\\x1f"; + chars = "\\u001F"; } ]; }; diff --git a/user/modules/dev.nix b/user/modules/dev.nix index 950b235..e5abd0b 100644 --- a/user/modules/dev.nix +++ b/user/modules/dev.nix @@ -12,10 +12,6 @@ php # Python python3 - # Kubernetes - azure-cli - kubectl - kubernetes-helm # Nix nil alejandra diff --git a/user/modules/emacs.nix b/user/modules/emacs.nix deleted file mode 100644 index 6424dac..0000000 --- a/user/modules/emacs.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - programs.emacs = { - enable = true; - package = pkgs.unstable.emacs; - extraPackages = epkgs: [epkgs.vterm]; - }; -} diff --git a/user/modules/firefox.nix b/user/modules/firefox.nix index e06cb6d..f209680 100644 --- a/user/modules/firefox.nix +++ b/user/modules/firefox.nix @@ -5,8 +5,8 @@ source = pkgs.fetchFromGitHub { owner = "rafaelmardojai"; repo = "firefox-gnome-theme"; - rev = "v121"; - hash = "sha256-M+Cw6vh7xCDmIhyVuEPNmaNVUwpmdFQq8zlsXZTKees="; + rev = "v126"; + hash = "sha256-jVbj2JD5GRkP8s3vKBtd9PDpftf3kjLR0ZA/ND/c2+Q="; }; }; diff --git a/user/modules/git_nixos.nix b/user/modules/git_nixos.nix index 6c76c5f..bdfabd3 100644 --- a/user/modules/git_nixos.nix +++ b/user/modules/git_nixos.nix @@ -5,6 +5,7 @@ credential.helper = "manager"; credential.credentialStore = "secretservice"; credential."git.thomasfmly.org".provider = "generic"; + credential."https://git.s.michaelt.xyz".provider = "generic"; }; }; diff --git a/user/modules/hyprland.nix b/user/modules/hyprland.nix index 6e525a9..ec71db8 100644 --- a/user/modules/hyprland.nix +++ b/user/modules/hyprland.nix @@ -1,7 +1,13 @@ -{pkgs, ...}: { +{ + pkgs, + inputs, + ... +}: { imports = [ - ./waybar - ./wofi + inputs.hyprland.homeManagerModules.default + # ./waybar + ./ironbar + ./wofi.nix ]; home.packages = with pkgs; [ @@ -11,7 +17,7 @@ wayland.windowManager.hyprland = { enable = true; - package = pkgs.unstable.hyprland; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; settings = { "$mod" = "SUPER"; general = { @@ -95,10 +101,12 @@ name = "Papirus"; package = pkgs.papirus-icon-theme; }; - cursorTheme = { - name = "Adwaita"; - package = pkgs.gnome.adwaita-icon-theme; - size = 24; - }; + }; + + home.pointerCursor = { + gtk.enable = true; + name = "Adwaita"; + package = pkgs.gnome.adwaita-icon-theme; + size = 24; }; } diff --git a/user/modules/ironbar/default.nix b/user/modules/ironbar/default.nix new file mode 100644 index 0000000..4304611 --- /dev/null +++ b/user/modules/ironbar/default.nix @@ -0,0 +1,80 @@ +{ + inputs, + lib, + ... +}: { + imports = [ + inputs.ironbar.homeManagerModules.default + ]; + + programs.ironbar = { + enable = true; + config = { + "anchor_to_edges" = true; + position = "top"; + start = [ + { + "type" = "workspaces"; + "all_monitors" = false; + # "name_map" = { + # "1" = "󰙯"; + # "2" = "icon:firefox"; + # "3" = ""; + # "Games" = "icon:steam"; + # "Code" = ""; + # }; + favorites = map (x: toString x) (lib.lists.range 1 8); + } + ]; + center = [ + { + type = "clock"; + } + ]; + end = [ + { + type = "volume"; + format = "{icon}"; + max_volume = 100; + icons = { + volume_high = "󰕾"; + volume_medium = "󰖀"; + volume_low = "󰕿"; + muted = "󰝟"; + }; + } + { + type = "notifications"; + show_count = true; + icons = { + closed_none = "󰍥"; + closed_some = "󱥂"; + closed_dnd = "󱅯"; + open_none = "󰍡"; + open_some = "󱥁"; + open_dnd = "󱅮"; + }; + } + ]; + }; + style = ""; + # package = inputs.ironbar; + systemd = false; + }; + + systemd.user.services.ironbar = { + Unit = { + Description = "Systemd service for Ironbar"; + Requires = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${inputs.ironbar}/bin/ironbar"; + }; + + Install.WantedBy = [ + "hyprland-session.target" + ]; + }; +} diff --git a/user/modules/nvim/lazy-lock.json b/user/modules/nvim/lazy-lock.json index 91b8616..475a915 100644 --- a/user/modules/nvim/lazy-lock.json +++ b/user/modules/nvim/lazy-lock.json @@ -41,4 +41,3 @@ "tree-sitter-asm": { "branch": "main", "commit": "b0306e9bb2ebe01c6562f1aef265cc42ccc53070" }, "trouble.nvim": { "branch": "main", "commit": "806c50491078b66daf13c408042f2e74da46d0ff" }, "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } -} \ No newline at end of file diff --git a/user/modules/nvim/lazyvim.json b/user/modules/nvim/lazyvim.json index 971da55..f03853f 100644 --- a/user/modules/nvim/lazyvim.json +++ b/user/modules/nvim/lazyvim.json @@ -1,6 +1,6 @@ { "extras": [ - "lazyvim.plugins.extras.lang.rust" + ], "news": { "NEWS.md": "3314" diff --git a/user/modules/nvim/lua/config/lazy.lua b/user/modules/nvim/lua/config/lazy.lua index 6f29dbd..9b0516e 100644 --- a/user/modules/nvim/lua/config/lazy.lua +++ b/user/modules/nvim/lua/config/lazy.lua @@ -11,7 +11,8 @@ require("lazy").setup({ -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins", opts = { colorscheme = "gruvbox" } }, -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + -- { import = "lazyvim.plugins.extras.lang.rust" }, -- { import = "lazyvim.plugins.extras.lang.json" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins diff --git a/user/modules/nvim/lua/plugins/lsp.lua b/user/modules/nvim/lua/plugins/lsp.lua index dde9307..4f2893d 100644 --- a/user/modules/nvim/lua/plugins/lsp.lua +++ b/user/modules/nvim/lua/plugins/lsp.lua @@ -1,17 +1,30 @@ return { { "neovim/nvim-lspconfig", - ---@class PluginLspOpts opts = { - ---@type lspconfig.options - ---@diagnostic disable-next-line: missing-fields servers = { - ---@diagnostic disable-next-line: missing-fields - tsserver = {}, - ---@diagnostic disable-next-line: missing-fields - eslint = {}, - nil_ls = {}, + rust_analyzer = {}, + taplo = { + keys = { + { + "K", + function() + if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then + require("crates").show_popup() + else + vim.lsp.buf.hover() + end + end, + desc = "Show Crate Documentation", + }, + }, + }, }, + -- setup = { + -- rust_analyzer = function() + -- return true + -- end, + -- }, }, }, { @@ -58,10 +71,17 @@ return { typescript = { { "prettierd", "prettier" } }, typescriptreact = { { "prettierd", "prettier" } }, yaml = { { "prettierd", "prettier" } }, + css = { { "prettierd", "prettier" } }, }, }, }, { "rush-rs/tree-sitter-asm", }, + { + "imsnif/kdl.vim", + }, + { + "andreshazard/vim-freemarker", + }, } diff --git a/user/modules/zsh.nix b/user/modules/zsh.nix index 6172308..35ba7c1 100644 --- a/user/modules/zsh.nix +++ b/user/modules/zsh.nix @@ -1,13 +1,8 @@ -{ - pkgs, - lib, - ... -}: { +{pkgs, ...}: { programs.zsh = { enable = true; - enableAutosuggestions = true; - # autosuggestion.enable = true; + autosuggestion.enable = true; syntaxHighlighting.enable = true; historySubstringSearch.enable = true; autocd = true;