diff --git a/common/gui/pipewire.nix b/common/gui/pipewire.nix index a482be6..59d66c6 100644 --- a/common/gui/pipewire.nix +++ b/common/gui/pipewire.nix @@ -5,7 +5,6 @@ ... }: { # Enable sound with pipewire. - sound.enable = true; hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { diff --git a/common/style/stylix.nix b/common/style/stylix.nix index ad0d471..2136fdc 100644 --- a/common/style/stylix.nix +++ b/common/style/stylix.nix @@ -1,7 +1,9 @@ {pkgs, ...}: { stylix = { - base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml"; - image = ./wallpaper.jpg; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml"; + # image = ./wallpaper.jpg; + image = ../../wallpapers/nix-black-4k.png; + #polarity = "dark"; autoEnable = true; enable = true; diff --git a/flake.lock b/flake.lock index ae9845d..b26e1ae 100644 --- a/flake.lock +++ b/flake.lock @@ -254,19 +254,17 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils_3", "nixpkgs": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1717408969, - "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", "owner": "numtide", "repo": "devshell", - "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", "type": "github" }, "original": { @@ -340,11 +338,11 @@ "flake-compat_5": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", "type": "github" }, "original": { @@ -369,52 +367,19 @@ "type": "github" } }, - "flake-compat_7": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_8": { - "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": { "nixpkgs-lib": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1722555600, + "narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "type": "github" }, "original": { @@ -464,11 +429,11 @@ "systems": "systems_5" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -513,25 +478,26 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_4", + "flake-compat": [ + "nixvim", + "flake-compat" + ], "gitignore": "gitignore_2", "nixpkgs": [ - "neovim-config", "nixvim", "nixpkgs" ], "nixpkgs-stable": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", "type": "github" }, "original": { @@ -565,7 +531,6 @@ "gitignore_2": { "inputs": { "nixpkgs": [ - "neovim-config", "nixvim", "git-hooks", "nixpkgs" @@ -586,28 +551,6 @@ } }, "gitignore_3": { - "inputs": { - "nixpkgs": [ - "neovim-config", - "pre-commit-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" - } - }, - "gitignore_4": { "inputs": { "nixpkgs": [ "pre-commit-hooks", @@ -694,17 +637,16 @@ "home-manager_2": { "inputs": { "nixpkgs": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1719588253, - "narHash": "sha256-A03i8xiVgP14DCmV5P7VUv37eodCjY4e1iai0b2EuuM=", + "lastModified": 1723399884, + "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", "owner": "nix-community", "repo": "home-manager", - "rev": "7e68e55d2e16d3a1e92a679430728c35a30fd24e", + "rev": "086f619dd991a4d355c07837448244029fc2d9ab", "type": "github" }, "original": { @@ -775,11 +717,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1723579231, - "narHash": "sha256-PL9C3aOetj+TS+vXvNhh7q5bm3g70oakg+iSu5eQBUQ=", + "lastModified": 1723656907, + "narHash": "sha256-11tgstIQZP3RRrBEF3ym9L6oS+vzqZJ7Mp6eB2PaN+0=", "ref": "refs/heads/main", - "rev": "3b4aabe04c7756fb0a70d78b6f0e701228f46345", - "revCount": 5087, + "rev": "197f8807900afc81c1c92ad17e621d1998ee268b", + "revCount": 5088, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -896,26 +838,6 @@ "type": "github" } }, - "neovim-config": { - "inputs": { - "nixpkgs": "nixpkgs_4", - "nixvim": "nixvim", - "pre-commit-hooks": "pre-commit-hooks_2" - }, - "locked": { - "lastModified": 1720909351, - "narHash": "sha256-LCu37KwuttiyteM3YceYwrRI7pbpJf/X6frWYNsUbos=", - "owner": "gwg313", - "repo": "nvim-nix", - "rev": "155587a7367579026137db5f4c882555e74205e3", - "type": "github" - }, - "original": { - "owner": "gwg313", - "repo": "nvim-nix", - "type": "github" - } - }, "nix": { "inputs": { "flake-compat": "flake-compat", @@ -945,17 +867,16 @@ "nix-darwin": { "inputs": { "nixpkgs": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1719128254, - "narHash": "sha256-I7jMpq0CAOZA/i70+HDQO/ulLttyQu/K70cSESiMX7A=", + "lastModified": 1722924007, + "narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "50581970f37f06a4719001735828519925ef8310", + "rev": "91010a5613ffd7ee23ee9263213157a1c422b705", "type": "github" }, "original": { @@ -1100,22 +1021,6 @@ } }, "nixpkgs-stable_2": { - "locked": { - "lastModified": 1718811006, - "narHash": "sha256-0Y8IrGhRmBmT7HHXlxxepg2t8j1X90++qRN3lukGaIk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "03d771e513ce90147b65fe922d87d3a0356fc125", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_3": { "locked": { "lastModified": 1720386169, "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", @@ -1131,7 +1036,7 @@ "type": "github" } }, - "nixpkgs-stable_4": { + "nixpkgs-stable_3": { "locked": { "lastModified": 1721524707, "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", @@ -1196,38 +1101,6 @@ } }, "nixpkgs_4": { - "locked": { - "lastModified": 1719506693, - "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1719506693, - "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { "locked": { "lastModified": 1723362943, "narHash": "sha256-dFZRVSgmJkyM0bkPpaYRtG/kRMRTorUIDj8BxoOt1T4=", @@ -1243,7 +1116,23 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_5": { + "locked": { + "lastModified": 1723175592, + "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { "locked": { "lastModified": 1721466660, "narHash": "sha256-pFSxgSZqZ3h+5Du0KvEL1ccDZBwu4zvOil1zzrPNb3c=", @@ -1259,7 +1148,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1715534503, "narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=", @@ -1284,14 +1173,15 @@ "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs_5", + "nuschtosSearch": "nuschtosSearch", "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1719766415, - "narHash": "sha256-VM/R+4pnY5twlwk/kCRNAgeyWQG7cjgXkhopboxwIi8=", + "lastModified": 1723670331, + "narHash": "sha256-bQaWqflbYdOn28NJHMTMMPgswlQRXhZh+a3WQAeyaFE=", "owner": "nix-community", "repo": "nixvim", - "rev": "714aa7bb18269b4ff8c3430e6b30689d340f3fcd", + "rev": "a96aa9730af8c85dd7ed15e359ac23e9686f0a9a", "type": "github" }, "original": { @@ -1300,6 +1190,28 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1723367906, + "narHash": "sha256-v1qA4WBGDI2uH/TVqRwuXSBP341W681psbzYJ8zrjog=", + "owner": "NuschtOS", + "repo": "search", + "rev": "6ca2c3ae05a915c160512bd41f6810f456c9b30d", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "poetry2nix": { "inputs": { "flake-utils": "flake-utils", @@ -1355,37 +1267,13 @@ }, "pre-commit-hooks_2": { "inputs": { - "flake-compat": "flake-compat_5", + "flake-compat": "flake-compat_4", "gitignore": "gitignore_3", "nixpkgs": [ - "neovim-config", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable_2" }, - "locked": { - "lastModified": 1719259945, - "narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks_3": { - "inputs": { - "flake-compat": "flake-compat_6", - "gitignore": "gitignore_4", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_3" - }, "locked": { "lastModified": 1723202784, "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", @@ -1406,11 +1294,11 @@ "devenv": "devenv", "home-manager": "home-manager", "hyprland": "hyprland", - "neovim-config": "neovim-config", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_4", "nixpkgs-unstable": "nixpkgs-unstable", - "pre-commit-hooks": "pre-commit-hooks_3", + "nixvim": "nixvim", + "pre-commit-hooks": "pre-commit-hooks_2", "sops-nix": "sops-nix", "stylix": "stylix", "superfile": "superfile" @@ -1418,8 +1306,8 @@ }, "sops-nix": { "inputs": { - "nixpkgs": "nixpkgs_7", - "nixpkgs-stable": "nixpkgs-stable_4" + "nixpkgs": "nixpkgs_6", + "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { "lastModified": 1723501126, @@ -1444,7 +1332,7 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_5", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", "nixpkgs": [ @@ -1467,10 +1355,10 @@ }, "superfile": { "inputs": { - "flake-compat": "flake-compat_8", + "flake-compat": "flake-compat_6", "flake-utils": "flake-utils_4", "gomod2nix": "gomod2nix", - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1722991483, @@ -1579,17 +1467,16 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "neovim-config", "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1719243788, - "narHash": "sha256-9T9mSY35EZSM1KAwb7K9zwQ78qTlLjosZgtUGnw4rn4=", + "lastModified": 1723454642, + "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "065a23edceff48f948816b795ea8cc6c0dee7cdf", + "rev": "349de7bc435bdff37785c2466f054ed1766173be", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 09f5e05..2baa7f0 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,7 @@ }; ags.url = "github:Aylur/ags"; - neovim-config.url = "github:gwg313/nvim-nix"; + # neovim-config.url = "github:gwg313/nvim-nix"; sops-nix.url = "github:Mic92/sops-nix"; @@ -46,6 +46,10 @@ url = "github:MHNightCat/superfile"; }; + nixvim = { + url = "github:nix-community/nixvim"; + }; + pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/home-manager/machines/candlekeep.nix b/home-manager/machines/candlekeep.nix index 8e21b63..48c0a61 100644 --- a/home-manager/machines/candlekeep.nix +++ b/home-manager/machines/candlekeep.nix @@ -27,6 +27,8 @@ ../modules/ssh.nix ../modules/gh-dash.nix ../modules/ags.nix + ../modules/neovim + ../modules/yazi.nix ]; nixpkgs = { @@ -39,9 +41,7 @@ # You can also add overlays exported from other flakes: # neovim-nightly-overlay.overlays.default - (final: prev: { - neovim = inputs.neovim-config.packages."x86_64-linux".default; - }) + (final: prev: {neovim = inputs.neovim-config.packages."x86_64-linux".default;}) # Or define it inline, for example: # (final: prev: { @@ -65,8 +65,8 @@ }; stylix = { - base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml"; - image = ./wallpaper.jpg; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml"; + image = ../../wallpapers/nix-black-4k.png; autoEnable = true; enable = true; @@ -103,9 +103,7 @@ # Add stuff for your user as you see fit: # programs.neovim.enable = true; - home.packages = with pkgs; [ - openvpn - ]; + home.packages = with pkgs; [openvpn]; # Enable home-manager and git programs.home-manager.enable = true; diff --git a/home-manager/machines/grymforge.nix b/home-manager/machines/grymforge.nix index e4c58e7..258144a 100644 --- a/home-manager/machines/grymforge.nix +++ b/home-manager/machines/grymforge.nix @@ -25,6 +25,8 @@ ../modules/devenv.nix ../modules/gh-dash.nix ../modules/ssh.nix + ../modules/neovim/default.nix + ../modules/yazi.nix ]; nixpkgs = { @@ -37,9 +39,9 @@ # You can also add overlays exported from other flakes: # neovim-nightly-overlay.overlays.default - (final: prev: { - neovim = inputs.neovim-config.packages."x86_64-linux".default; - }) + # (final: prev: { + # neovim = inputs.neovim-config.packages."x86_64-linux".default; + # }) # Or define it inline, for example: # (final: prev: { @@ -63,10 +65,12 @@ }; stylix = { - base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml"; - image = ./wallpaper.jpg; + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml"; + image = ../../wallpapers/nix-black-4k.png; + # polarity = "dark"; autoEnable = true; enable = true; + targets.nixvim.enable = false; opacity.terminal = 1.0; fonts.sizes.terminal = 20; @@ -101,9 +105,7 @@ # Add stuff for your user as you see fit: # programs.neovim.enable = true; - home.packages = with pkgs; [ - openvpn - ]; + home.packages = with pkgs; [openvpn]; # Enable home-manager and git programs.home-manager.enable = true; diff --git a/home-manager/machines/wallpaper2.png b/home-manager/machines/wallpaper2.png new file mode 100644 index 0000000..1cd2ed9 Binary files /dev/null and b/home-manager/machines/wallpaper2.png differ diff --git a/home-manager/modules/ags.nix b/home-manager/modules/ags.nix index df7169a..c7b4e26 100644 --- a/home-manager/modules/ags.nix +++ b/home-manager/modules/ags.nix @@ -10,6 +10,7 @@ gtksourceview webkitgtk accountsservice + libdbusmenu-gtk3 ]; }; } diff --git a/home-manager/modules/alacritty.nix b/home-manager/modules/alacritty.nix index 1d25e41..dfe4dd6 100644 --- a/home-manager/modules/alacritty.nix +++ b/home-manager/modules/alacritty.nix @@ -1,9 +1,12 @@ # A fast, GPU-accelerated terminal emulator. -{...}: { +{pkgs, ...}: { programs.alacritty = { enable = true; settings = { - env = {TERM = "xterm-256color";}; + env = { + TERM = "xterm-256color"; + }; }; }; + home.packages = with pkgs; [ueberzugpp]; } diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix index 2c8b4cd..bd95e35 100644 --- a/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -21,7 +21,7 @@ home.packages = with pkgs; [ # Editors - neovim # Improved version of vim, often used with overlays. + # neovim # Improved version of vim, often used with overlays. vim # Highly configurable text editor popular for efficiency and extensibility. # Builtin Replacements @@ -53,6 +53,9 @@ tree # Displays directory structure in a tree-like format. unzip # Command-line tool for extracting files from ZIP archives. yt-dlp # Fork of youtube-dl, facilitating video downloads from various sites. + age + portal + atac # TUI Apps #ncdu_2 @@ -77,6 +80,7 @@ entr # Event notifier for automation and development, executing commands whenever files change in the specified directory. git-cliff # Tool for visualizing project commit history and generating release notes. grex # Tool generating regular expressions from user-provided test cases. + sshs # Nix Tools alejandra # Nix code formatter. diff --git a/home-manager/modules/neovim/default.nix b/home-manager/modules/neovim/default.nix new file mode 100644 index 0000000..23e1334 --- /dev/null +++ b/home-manager/modules/neovim/default.nix @@ -0,0 +1,26 @@ +# A cat clone with syntax highlighting and Git integration. +{inputs, ...}: { + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ./options.nix + ./plugins + ]; + programs.nixvim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + luaLoader.enable = true; + + performance = { + combinePlugins = { + enable = true; + standalonePlugins = [ + "hmts.nvim" + "nvim-treesitter" + ]; + }; + byteCompileLua.enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/options.nix b/home-manager/modules/neovim/options.nix new file mode 100644 index 0000000..b8c63bd --- /dev/null +++ b/home-manager/modules/neovim/options.nix @@ -0,0 +1,64 @@ +{ + programs.nixvim = { + globals = { + mapleader = " "; + # Disable useless providers + loaded_ruby_provider = 0; # Ruby + loaded_perl_provider = 0; # Perl + loaded_python_provider = 0; # Python 2 + }; + + clipboard = { + # Use system clipboard + register = "unnamedplus"; + + providers.wl-copy.enable = true; + }; + + opts = { + updatetime = 100; # Faster completion + + # Line numbers + relativenumber = true; # Relative line numbers + number = true; # Display the absolute line number of the current line + hidden = true; # Keep closed buffer open in the background + mouse = "a"; # Enable mouse control + mousemodel = "extend"; # Mouse right-click extends the current selection + splitbelow = true; # A new window is put below the current one + splitright = true; # A new window is put right of the current one + + swapfile = false; # Disable the swap file + modeline = true; # Tags such as 'vim:ft=sh' + modelines = 100; # Sets the type of modelines + undofile = true; # Automatically save and restore undo history + incsearch = true; # Incremental search: show match for partly typed search command + inccommand = "split"; # Search and replace: preview changes in quickfix list + ignorecase = true; # When the search query is lower-case, match both lower and upper-case + # patterns + smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper + # case characters + scrolloff = 8; # Number of screen lines to show around the cursor + cursorline = false; # Highlight the screen line of the cursor + cursorcolumn = false; # Highlight the screen column of the cursor + signcolumn = "yes"; # Whether to show the signcolumn + colorcolumn = ""; # Columns to highlight + laststatus = 3; # When to use a status line for the last window + fileencoding = "utf-8"; # File-content encoding for the current buffer + termguicolors = true; # Enables 24-bit RGB color in the |TUI| + spell = false; # Highlight spelling mistakes (local to window) + wrap = false; # Prevent text from wrapping + + # Tab options + tabstop = 4; # Number of spaces a in the text stands for (local to buffer) + shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer) + expandtab = true; # Expand to spaces in Insert mode (local to buffer) + autoindent = true; # Do clever autoindenting + + textwidth = 0; # Maximum width of text that is being inserted. A longer line will be + # broken after white space to get this width. + + # Folding + foldlevel = 99; # Folds with a level higher than this number will be closed + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/autopairs.nix b/home-manager/modules/neovim/plugins/autopairs.nix new file mode 100644 index 0000000..0d364a5 --- /dev/null +++ b/home-manager/modules/neovim/plugins/autopairs.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nvim-autopairs = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/bufferline.nix b/home-manager/modules/neovim/plugins/bufferline.nix new file mode 100644 index 0000000..4e628d6 --- /dev/null +++ b/home-manager/modules/neovim/plugins/bufferline.nix @@ -0,0 +1,231 @@ +{...}: { + programs.nixvim = { + plugins.bufferline = let + mouse = { + right = + # lua + "'vertical sbuffer %d'"; + close = + # lua + '' + function(bufnum) + require("mini.bufremove").delete(bufnum) + end + ''; + }; + in { + enable = true; + + settings = { + options = { + mode = "buffers"; + always_show_bufferline = true; + buffer_close_icon = "󰅖"; + close_command.__raw = mouse.close; + close_icon = ""; + diagnostics = "nvim_lsp"; + diagnostics_indicator = + # lua + '' + function(count, level, diagnostics_dict, context) + local s = "" + for e, n in pairs(diagnostics_dict) do + local sym = e == "error" and " " + or (e == "warning" and " " or "" ) + if(sym ~= "") then + s = s .. " " .. n .. sym + end + end + return s + end + ''; + # Will make sure all names in bufferline are unique + enforce_regular_tabs = false; + + groups = { + options = { + toggle_hidden_on_enter = true; + }; + + items = [ + { + name = "Tests"; + highlight = { + underline = true; + fg = "#a6da95"; + sp = "#494d64"; + }; + priority = 2; + # icon = ""; + matcher.__raw = + # lua + '' + function(buf) + return buf.name:match('%test') or buf.name:match('%.spec') + end + ''; + } + { + name = "Docs"; + highlight = { + undercurl = true; + fg = "#ffffff"; + sp = "#494d64"; + }; + auto_close = false; + matcher.__raw = + # lua + '' + function(buf) + return buf.name:match('%.md') or buf.name:match('%.txt') + end + ''; + } + ]; + }; + + indicator = { + style = "icon"; + icon = "▎"; + }; + + left_trunc_marker = ""; + max_name_length = 18; + max_prefix_length = 15; + modified_icon = "●"; + + numbers.__raw = + # lua + '' + function(opts) + return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal)) + end + ''; + + persist_buffer_sort = true; + right_mouse_command.__raw = mouse.right; + right_trunc_marker = ""; + separator_style = "slant"; + show_buffer_close_icons = true; + show_buffer_icons = true; + show_close_icon = true; + show_tab_indicators = true; + sort_by = "extension"; + tab_size = 18; + + offsets = [ + { + filetype = "neo-tree"; + text = "File Explorer"; + text_align = "center"; + highlight = "Directory"; + } + ]; + }; + + # NOTE: fixes colorscheme with transparent_background + # and better contrast selected tabs + highlights = let + commonBgColor = "#363a4f"; + commonFgColor = "#1e2030"; + + commonSelectedAttrs = { + bg = commonBgColor; + }; + + # Define a set with common selected attributes + selectedAttrsSet = builtins.listToAttrs ( + map + (name: { + inherit name; + value = commonSelectedAttrs; + }) + [ + # "separator_selected" # Handled uniquely + "buffer_selected" + "tab_selected" + "numbers_selected" + "close_button_selected" + "duplicate_selected" + "modified_selected" + "info_selected" + "warning_selected" + "error_selected" + "hint_selected" + "diagnostic_selected" + "info_diagnostic_selected" + "warning_diagnostic_selected" + "error_diagnostic_selected" + "hint_diagnostic_selected" + ] + ); + in + # Merge the common selected attributes with the unique attributes + selectedAttrsSet + // { + fill = { + bg = commonFgColor; + }; + separator = { + fg = commonFgColor; + }; + separator_visible = { + fg = commonFgColor; + }; + separator_selected = { + bg = commonBgColor; + fg = commonFgColor; + }; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "bP"; + action = ":BufferLineTogglePin"; + options = { + desc = "Pin buffer toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "bp"; + action = ":BufferLinePick"; + options = { + desc = "Pick Buffer"; + silent = true; + }; + } + { + mode = "n"; + key = "bsd"; + action = ":BufferLineSortByDirectory"; + options = { + desc = "Sort By Directory"; + silent = true; + }; + } + { + mode = "n"; + key = "bse"; + action = ":BufferLineSortByExtension"; + options = { + desc = "Sort By Extension"; + silent = true; + }; + } + { + mode = "n"; + key = "bsr"; + action = ":BufferLineSortByRelativeDirectory"; + options = { + desc = "Sort By Relative Directory"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/catppuccin.nix b/home-manager/modules/neovim/plugins/catppuccin.nix new file mode 100644 index 0000000..734a1b9 --- /dev/null +++ b/home-manager/modules/neovim/plugins/catppuccin.nix @@ -0,0 +1,65 @@ +_: { + programs.nixvim = { + colorschemes.catppuccin = { + enable = true; + settings = { + dim_inactive = { + enabled = false; + percentage = 0.25; + }; + + flavour = "macchiato"; + + integrations = { + aerial = true; + cmp = true; + dap = { + enabled = true; + enable_ui = true; + }; + gitsigns = true; + headlines = true; + markdown = true; + mason = true; + mini.enabled = true; + + native_lsp = { + enabled = true; + virtual_text = { + errors = ["italic"]; + hints = ["italic"]; + warnings = ["italic"]; + information = ["italic"]; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + warnings = ["underline"]; + information = ["underline"]; + }; + inlay_hints = { + background = false; + }; + }; + + neogit = true; + neotree = false; + noice = true; + notify = true; + rainbow_delimiters = true; + sandwich = true; + semantic_tokens = true; + symbols_outline = true; + telescope = { + enabled = true; + # style = "nvchad"; + }; + treesitter = true; + which_key = true; + }; + + transparent_background = false; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/comment.nix b/home-manager/modules/neovim/plugins/comment.nix new file mode 100644 index 0000000..3d0e571 --- /dev/null +++ b/home-manager/modules/neovim/plugins/comment.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.comment = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/conform.nix b/home-manager/modules/neovim/plugins/conform.nix new file mode 100644 index 0000000..ef095e7 --- /dev/null +++ b/home-manager/modules/neovim/plugins/conform.nix @@ -0,0 +1,231 @@ +{ + lib, + pkgs, + ... +}: { + programs.nixvim = { + extraConfigLuaPre = + # lua + '' + local slow_format_filetypes = {} + + vim.api.nvim_create_user_command("FormatDisable", function(args) + if args.bang then + -- FormatDisable! will disable formatting just for this buffer + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end + end, { + desc = "Disable autoformat-on-save", + bang = true, + }) + vim.api.nvim_create_user_command("FormatEnable", function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false + end, { + desc = "Re-enable autoformat-on-save", + }) + vim.api.nvim_create_user_command("FormatToggle", function(args) + if args.bang then + -- Toggle formatting for current buffer + vim.b.disable_autoformat = not vim.b.disable_autoformat + else + -- Toggle formatting globally + vim.g.disable_autoformat = not vim.g.disable_autoformat + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; + + plugins = { + conform-nvim = { + enable = true; + + formatOnSave = + # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + local function on_format(err) + if err and err:match("timeout$") then + slow_format_filetypes[vim.bo[bufnr].filetype] = true + end + end + + return { timeout_ms = 200, lsp_fallback = true }, on_format + end + ''; + + formatAfterSave = + # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if not slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + return { lsp_fallback = true } + end + ''; + + # NOTE: + # Conform will run multiple formatters sequentially + # [ "1" "2" "3"] + # Use a sub-list to run only the first available formatter + # [ ["1"] ["2"] ["3"] ] + # Use the "*" filetype to run formatters on all filetypes. + # Use the "_" filetype to run formatters on filetypes that don't + # have other formatters configured. + formattersByFt = { + bash = [ + "shellcheck" + "shellharden" + "shfmt" + ]; + bicep = ["bicep"]; + c = ["clang_format"]; + cmake = ["cmake-format"]; + cpp = ["clang_format"]; + cs = ["csharpier"]; + css = ["stylelint"]; + fish = ["fish_indent"]; + fsharp = ["fantomas"]; + haskell = ["ormolu"]; + javascript = [ + [ + "prettierd" + "prettier" + ] + ]; + json = ["jq"]; + lua = ["stylua"]; + markdown = ["deno_fmt"]; + nix = ["nixfmt"]; + python = [ + "isort" + "black" + ]; + rust = ["rustfmt"]; + sh = [ + "shellcheck" + "shellharden" + "shfmt" + ]; + sql = ["sqlfluff"]; + swift = ["swift_format"]; + terraform = ["terraform_fmt"]; + toml = ["taplo"]; + typescript = [ + [ + "prettierd" + "prettier" + ] + ]; + xml = [ + "xmlformat" + "xmllint" + ]; + yaml = ["yamlfmt"]; + zig = ["zigfmt"]; + "_" = [ + "squeeze_blanks" + "trim_whitespace" + "trim_newlines" + ]; + }; + + formatters = { + black = { + command = lib.getExe pkgs.black; + }; + bicep = { + command = lib.getExe pkgs.bicep; + }; + cmake-format = { + command = lib.getExe pkgs.cmake-format; + }; + csharpier = { + command = lib.getExe pkgs.csharpier; + }; + deno_fmt = { + command = lib.getExe pkgs.deno; + }; + isort = { + command = lib.getExe pkgs.isort; + }; + fantomas = { + command = lib.getExe pkgs.fantomas; + }; + ormolu = { + command = lib.getExe pkgs.ormolu; + }; + jq = { + command = lib.getExe pkgs.jq; + }; + nixfmt = { + command = lib.getExe pkgs.nixfmt-rfc-style; + }; + prettierd = { + command = lib.getExe pkgs.prettierd; + }; + rustfmt = { + command = lib.getExe pkgs.rustfmt; + }; + shellcheck = { + command = lib.getExe pkgs.shellcheck; + }; + shfmt = { + command = lib.getExe pkgs.shfmt; + }; + shellharden = { + command = lib.getExe pkgs.shellharden; + }; + sqlfluff = { + command = lib.getExe pkgs.sqlfluff; + }; + squeeze_blanks = { + comamnd = lib.getExe' pkgs.coreutils "cat"; + }; + stylelint = { + command = lib.getExe pkgs.stylelint; + }; + stylua = { + command = lib.getExe pkgs.stylua; + }; + swift_format = { + command = lib.getExe pkgs.swift-format; + }; + taplo = { + command = lib.getExe pkgs.taplo; + }; + terraform_fmt = { + command = lib.getExe pkgs.terraform; + }; + xmlformat = { + command = lib.getExe pkgs.xmlformat; + }; + yamlfmt = { + command = lib.getExe pkgs.yamlfmt; + }; + zigfmt = { + command = lib.getExe pkgs.zig; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/default.nix b/home-manager/modules/neovim/plugins/default.nix new file mode 100644 index 0000000..8892b32 --- /dev/null +++ b/home-manager/modules/neovim/plugins/default.nix @@ -0,0 +1,33 @@ +_: { + imports = [ + # ./none-ls.nix + ./autopairs.nix + ./bufferline.nix + ./catppuccin.nix + ./comment.nix + ./conform.nix + ./diffview.nix + ./flash.nix + ./git-conflict.nix + ./gitsigns.nix + ./harpoon.nix + ./illuminate.nix + ./lightbulb.nix + ./lualine.nix + ./lsp.nix + ./mini-bufremove.nix + ./navic.nix + ./nix.nix + ./noice.nix + ./notify.nix + ./precognition.nix + ./spectre.nix + ./telescope.nix + ./todo-comments.nix + ./toggleterm.nix + ./treesitter.nix + ./trouble.nix + ./which-key.nix + ./yazi.nix + ]; +} diff --git a/home-manager/modules/neovim/plugins/diffview.nix b/home-manager/modules/neovim/plugins/diffview.nix new file mode 100644 index 0000000..828e5ea --- /dev/null +++ b/home-manager/modules/neovim/plugins/diffview.nix @@ -0,0 +1,32 @@ +{...}: { + programs.nixvim = { + plugins = { + diffview = { + enable = true; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "gd"; + action.__raw = + # lua + '' + function() + vim.g.diffview_enabled = not vim.g.diffview_enabled + if vim.g.diffview_enabled then + vim.cmd('DiffviewClose') + else + vim.cmd('DiffviewOpen') + end + end + ''; + options = { + desc = "Git Diff toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/flash.nix b/home-manager/modules/neovim/plugins/flash.nix new file mode 100644 index 0000000..dd18195 --- /dev/null +++ b/home-manager/modules/neovim/plugins/flash.nix @@ -0,0 +1,93 @@ +{...}: { + programs.nixvim = { + plugins.flash = { + enable = true; + settings = { + labels = "rsthnaio"; + }; + }; + + keymaps = [ + { + mode = [ + "n" + "x" + "o" + ]; + key = "s"; + action.__raw = '' + function() + require("flash").jump() + end + ''; + options = { + silent = true; + desc = "Flash"; + }; + } + + { + mode = [ + "n" + "x" + "o" + ]; + key = "S"; + action.__raw = '' + function() + require("flash").treesitter() + end + ''; + options = { + silent = true; + desc = "Flash Treesitter"; + }; + } + + { + mode = "o"; + key = "r"; + action.__raw = '' + function() + require("flash").remote() + end + ''; + options = { + silent = true; + desc = "Flash Remote"; + }; + } + + { + mode = [ + "o" + "x" + ]; + key = "R"; + action.__raw = '' + function() + require("flash").treesitter_search() + end + ''; + options = { + silent = true; + desc = "Treesitter Search"; + }; + } + + { + mode = "c"; + key = ""; + action.__raw = '' + function() + require("flash").toggle() + end + ''; + options = { + silent = true; + desc = "Toggle Flash Search"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/git-conflict.nix b/home-manager/modules/neovim/plugins/git-conflict.nix new file mode 100644 index 0000000..7820cc2 --- /dev/null +++ b/home-manager/modules/neovim/plugins/git-conflict.nix @@ -0,0 +1,20 @@ +_: { + programs.nixvim = { + plugins = { + git-conflict = { + enable = true; + + settings = { + default_mappings = { + ours = "co"; + theirs = "ct"; + none = "c0"; + both = "cb"; + next = "]x"; + prev = "[x"; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/gitsigns.nix b/home-manager/modules/neovim/plugins/gitsigns.nix new file mode 100644 index 0000000..c787576 --- /dev/null +++ b/home-manager/modules/neovim/plugins/gitsigns.nix @@ -0,0 +1,118 @@ +{...}: { + programs.nixvim = { + plugins.gitsigns = { + enable = true; + settings = { + signs = { + add.text = "▎"; + change.text = "▎"; + delete.text = "󰐊"; + topdelete.text = "󰐊"; + changedelete.text = "󰐊"; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "gs"; + action = "Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + + { + mode = "n"; + key = "gr"; + action = "Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + + { + mode = "v"; + key = "gs"; + action = "lua function() Gitsigns stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + + { + mode = "v"; + key = "gr"; + action = "function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + + { + mode = "n"; + key = "gS"; + action = "Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + + { + mode = "n"; + key = "gu"; + action = "Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + + { + mode = "n"; + key = "gR"; + action = " Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + + { + mode = "n"; + key = "gp"; + action = " Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview Hunk"; + }; + } + + { + mode = "n"; + key = "gb"; + action = " Gitsigns toggle_current_line_blame"; + options = { + silent = true; + desc = "Blame"; + }; + } + + # { + # mode = "n"; + # key = "gd"; + # action = " Gitsigns diffthis"; + # options = { + # silent = true; + # desc = "Diff"; + # }; + # } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/harpoon.nix b/home-manager/modules/neovim/plugins/harpoon.nix new file mode 100644 index 0000000..217d766 --- /dev/null +++ b/home-manager/modules/neovim/plugins/harpoon.nix @@ -0,0 +1,59 @@ +{...}: { + programs.nixvim = { + plugins = { + harpoon.enable = true; + which-key.settings.spec = [ + { + __unkeyed = "m"; + mode = "n"; + group = "󱋼 Marks"; + } + ]; + }; + + keymaps = [ + { + mode = "n"; + key = "mm"; + action = ":lua require('harpoon.ui').toggle_quick_menu()"; + # lua = true; + options = { + silent = true; + desc = "Mark Menu"; + }; + } + + { + mode = "n"; + key = "ma"; + action = ":lua require('harpoon.mark').add_file()"; + # lua = true; + options = { + silent = true; + desc = "Mark File"; + }; + } + { + mode = "n"; + key = "mn"; + action = ":lua require('harpoon.ui').nav_next()"; + # lua = true; + options = { + silent = true; + desc = "Next Mark"; + }; + } + + { + mode = "n"; + key = "mp"; + action = ":lua require('harpoon.ui').nav_prev()"; + # lua = true; + options = { + silent = true; + desc = "Prev Mark"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/illuminate.nix b/home-manager/modules/neovim/plugins/illuminate.nix new file mode 100644 index 0000000..bd33560 --- /dev/null +++ b/home-manager/modules/neovim/plugins/illuminate.nix @@ -0,0 +1,17 @@ +{...}: { + programs.nixvim = { + plugins = { + illuminate = { + enable = true; + + filetypesDenylist = [ + "dirvish" + "fugitive" + "neo-tree" + "TelescopePrompt" + ]; + largeFileCutoff = 3000; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lightbulb.nix b/home-manager/modules/neovim/plugins/lightbulb.nix new file mode 100644 index 0000000..d32a74e --- /dev/null +++ b/home-manager/modules/neovim/plugins/lightbulb.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nvim-lightbulb = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lsp.nix b/home-manager/modules/neovim/plugins/lsp.nix new file mode 100644 index 0000000..22fc319 --- /dev/null +++ b/home-manager/modules/neovim/plugins/lsp.nix @@ -0,0 +1,123 @@ +{ + lib, + pkgs, + ... +}: { + programs.nixvim = { + extraConfigLuaPre = + # lua + '' + vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticError", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticWarn", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignHint", { text = " 󰌵", texthl = "DiagnosticHint", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticInfo", linehl = "", numhl = "" }) + ''; + plugins = { + lspkind.enable = true; + lsp-lines.enable = true; + lsp-format.enable = false; # conform-nvim does this + lsp = { + enable = true; + keymaps = { + silent = true; + diagnostic = { + # Navigate in diagnostics + "lp" = "goto_prev"; + "ln" = "goto_next"; + }; + + extra = [ + { + action.__raw = + # lua + '' + function() + vim.lsp.buf.format({ + async = true, + range = { + ["start"] = vim.api.nvim_buf_get_mark(0, "<"), + ["end"] = vim.api.nvim_buf_get_mark(0, ">"), + } + }) + end + ''; + mode = "v"; + key = "lf"; + options = { + desc = "Format selection"; + }; + } + ]; + + lspBuf = { + "la" = "code_action"; + "ld" = "definition"; + "lf" = "format"; + "lD" = "references"; + "lt" = "type_definition"; + "li" = "implementation"; + "lh" = "hover"; + "lr" = "rename"; + }; + }; + servers = { + nil-ls = { + enable = true; + filetypes = ["nix"]; + settings = { + formatting = { + command = ["${lib.getExe pkgs.nixfmt-rfc-style}"]; + }; + }; + }; + }; + }; + which-key.settings.spec = [ + { + __unkeyed = "l"; + group = " LSP"; + } + { + __unkeyed = "la"; + desc = "Code Action"; + } + { + __unkeyed = "ld"; + desc = "Definition"; + } + { + __unkeyed = "lD"; + desc = "References"; + } + { + __unkeyed = "lf"; + desc = "Format"; + } + { + __unkeyed = "lp"; + desc = "Prev"; + } + { + __unkeyed = "ln"; + desc = "Next"; + } + { + __unkeyed = "lt"; + desc = "Type Definition"; + } + { + __unkeyed = "li"; + desc = "Implementation"; + } + { + __unkeyed = "lh"; + desc = "Hover"; + } + { + __unkeyed = "lr"; + desc = "Rename"; + } + ]; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lualine.nix b/home-manager/modules/neovim/plugins/lualine.nix new file mode 100644 index 0000000..d4f3088 --- /dev/null +++ b/home-manager/modules/neovim/plugins/lualine.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.lualine = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/mini-bufremove.nix b/home-manager/modules/neovim/plugins/mini-bufremove.nix new file mode 100644 index 0000000..7be1a6b --- /dev/null +++ b/home-manager/modules/neovim/plugins/mini-bufremove.nix @@ -0,0 +1,64 @@ +{...}: { + programs.nixvim = { + plugins = { + mini = { + enable = true; + + modules = { + bufremove = {}; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "c"; + action.__raw = + # lua + ''require("mini.bufremove").delete''; + options = { + desc = "Close buffer"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action.__raw = + # lua + ''require("mini.bufremove").delete''; + options = { + desc = "Close buffer"; + silent = true; + }; + } + { + mode = "n"; + key = "bc"; + action.__raw = + # lua + '' + function () + local current = vim.api.nvim_get_current_buf() + + local get_listed_bufs = function() + return vim.tbl_filter(function(bufnr) + return vim.api.nvim_buf_get_option(bufnr, "buflisted") + end, vim.api.nvim_list_bufs()) + end + + for _, bufnr in ipairs(get_listed_bufs()) do + if bufnr ~= current + then require("mini.bufremove").delete(bufnr) + end + end + end + ''; + options = { + desc = "Close all buffers but current"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/navic.nix b/home-manager/modules/neovim/plugins/navic.nix new file mode 100644 index 0000000..1586597 --- /dev/null +++ b/home-manager/modules/neovim/plugins/navic.nix @@ -0,0 +1,8 @@ +{...}: { + programs.nixvim = { + plugins.navic = { + enable = true; + lsp.autoAttach = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/nix.nix b/home-manager/modules/neovim/plugins/nix.nix new file mode 100644 index 0000000..4cb6373 --- /dev/null +++ b/home-manager/modules/neovim/plugins/nix.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nix = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/noice.nix b/home-manager/modules/neovim/plugins/noice.nix new file mode 100644 index 0000000..c317a16 --- /dev/null +++ b/home-manager/modules/neovim/plugins/noice.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.noice = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/none-ls.nix b/home-manager/modules/neovim/plugins/none-ls.nix new file mode 100644 index 0000000..6b28be8 --- /dev/null +++ b/home-manager/modules/neovim/plugins/none-ls.nix @@ -0,0 +1,32 @@ +{...}: { + programs.nixvim = { + plugins.none-ls = { + enable = true; + settings = { + cmd = ["bash -c nvim"]; + + debug = true; + }; + sources = { + code_actions = { + statix.enable = true; + }; + diagnostics = { + statix.enable = true; + deadnix.enable = true; + }; + formatting = { + alejandra.enable = true; + stylua.enable = true; + shfmt.enable = true; + nixpkgs_fmt.enable = true; + # prettier = { + # enable = true; + # disableTsServerFormatter = true; + # }; + # black.enable = true; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/notify.nix b/home-manager/modules/neovim/plugins/notify.nix new file mode 100644 index 0000000..d87e2a9 --- /dev/null +++ b/home-manager/modules/neovim/plugins/notify.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.notify = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/precognition.nix b/home-manager/modules/neovim/plugins/precognition.nix new file mode 100644 index 0000000..5d53168 --- /dev/null +++ b/home-manager/modules/neovim/plugins/precognition.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + programs.nixvim = { + extraPlugins = [pkgs.vimPlugins.precognition-nvim]; + + keymaps = [ + { + mode = "n"; + key = "uP"; + action.__raw = '' + function() + if require("precognition").toggle() then + vim.notify("precognition on") + else + vim.notify("precognition off") + end + end + ''; + + options = { + desc = "Precognition Toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/spectre.nix b/home-manager/modules/neovim/plugins/spectre.nix new file mode 100644 index 0000000..3d35555 --- /dev/null +++ b/home-manager/modules/neovim/plugins/spectre.nix @@ -0,0 +1,21 @@ +{...}: { + programs.nixvim = { + plugins = { + spectre = { + enable = true; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "rs"; + action = ":Spectre"; + options = { + desc = "Spectre toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/telescope.nix b/home-manager/modules/neovim/plugins/telescope.nix new file mode 100644 index 0000000..37e48e4 --- /dev/null +++ b/home-manager/modules/neovim/plugins/telescope.nix @@ -0,0 +1,240 @@ +{pkgs, ...}: { + programs.nixvim = { + extraPackages = with pkgs; [ripgrep]; + + keymaps = [ + { + mode = "n"; + key = "fc"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").find_files { + prompt_title = "Config Files", + cwd = vim.fn.stdpath "config", + follow = true, + } + end + ''; + options = { + desc = "Find config files"; + silent = true; + }; + } + { + mode = "n"; + key = "fF"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").find_files({ hidden = true, no_ignore = true}) + end + ''; + options = { + desc = "Find all files"; + silent = true; + }; + } + { + mode = "n"; + key = "fT"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").colorscheme({ enable_preview = true }) + end + ''; + options = { + desc = "Find theme"; + silent = true; + }; + } + { + mode = "n"; + key = "fW"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").live_grep { + additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end, + } + end + ''; + options = { + desc = "Find words in all files"; + silent = true; + }; + } + { + mode = "n"; + key = "f?"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").live_grep { grep_open_files=true } + end + ''; + options = { + desc = "Find words in all open buffers"; + silent = true; + }; + } + { + mode = "n"; + key = "fe"; + action = ":Telescope file_browser"; + options = { + desc = "File Explorer"; + silent = true; + }; + } + # { + # mode = "n"; + # key = "fO"; + # action = ":Telescope frecency"; + # options = { + # desc = "Find Frequent Files"; + # silent = true; + # }; + # } + ]; + + plugins.telescope = { + enable = true; + + extensions = { + file-browser = { + enable = true; + settings = { + hidden = true; + }; + }; + + # FIX: annoying frecency validation on startup about removed files + # frecency = { + # enable = true; + # }; + + ui-select = { + enable = true; + }; + }; + + keymaps = { + "f'" = { + action = "marks"; + options.desc = "View marks"; + }; + "f/" = { + action = "current_buffer_fuzzy_find"; + options.desc = "Fuzzy find in current buffer"; + }; + "f" = { + action = "resume"; + options.desc = "Resume action"; + }; + "fa" = { + action = "autocommands"; + options.desc = "View autocommands"; + }; + "fC" = { + action = "commands"; + options.desc = "View commands"; + }; + "fb" = { + action = "buffers"; + options.desc = "View buffers"; + }; + "fc" = { + action = "grep_string"; + options.desc = "Grep string"; + }; + "fd" = { + action = "diagnostics"; + options.desc = "View diagnostics"; + }; + "ff" = { + action = "find_files"; + options.desc = "Find files"; + }; + "fh" = { + action = "help_tags"; + options.desc = "View help tags"; + }; + "fk" = { + action = "keymaps"; + options.desc = "View keymaps"; + }; + "fm" = { + action = "man_pages"; + options.desc = "View man pages"; + }; + "fo" = { + action = "oldfiles"; + options.desc = "View old files"; + }; + "fr" = { + action = "registers"; + options.desc = "View registers"; + }; + "fs" = { + action = "lsp_document_symbols"; + options.desc = "Search symbols"; + }; + "fq" = { + action = "quickfix"; + options.desc = "Search quickfix"; + }; + "fw" = { + action = "live_grep"; + options.desc = "Live grep"; + }; + "gC" = { + action = "git_bcommits"; + options.desc = "View git bcommits"; + }; + "gB" = { + action = "git_branches"; + options.desc = "View git branches"; + }; + "gc" = { + action = "git_commits"; + options.desc = "View git commits"; + }; + "gs" = { + action = "git_status"; + options.desc = "View git status"; + }; + "gS" = { + action = "git_stash"; + options.desc = "View git stashes"; + }; + }; + + settings = { + defaults = { + file_ignore_patterns = [ + "^.git/" + "^.mypy_cache/" + "^__pycache__/" + "^output/" + "^data/" + "%.ipynb" + ]; + set_env.COLORTERM = "truecolor"; + }; + + pickers = { + colorscheme = { + enable_preview = true; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/todo-comments.nix b/home-manager/modules/neovim/plugins/todo-comments.nix new file mode 100644 index 0000000..29a03cf --- /dev/null +++ b/home-manager/modules/neovim/plugins/todo-comments.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.todo-comments = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/toggleterm.nix b/home-manager/modules/neovim/plugins/toggleterm.nix new file mode 100644 index 0000000..e45efaa --- /dev/null +++ b/home-manager/modules/neovim/plugins/toggleterm.nix @@ -0,0 +1,57 @@ +{...}: { + programs.nixvim = { + plugins.toggleterm = { + enable = true; + + settings = { + direction = "float"; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "tt"; + action = ":ToggleTerm"; + options = { + desc = "Open Terminal"; + silent = true; + }; + } + { + mode = "n"; + key = "tg"; + action.__raw = + # lua + '' + function() + local toggleterm = require('toggleterm.terminal') + + toggleterm.Terminal:new({cmd = 'lazygit',hidden = true}):toggle() + end + ''; + options = { + desc = "Open Lazygit"; + silent = true; + }; + } + { + mode = "n"; + key = "gg"; + action.__raw = + # lua + '' + function() + local toggleterm = require('toggleterm.terminal') + + toggleterm.Terminal:new({cmd = 'lazygit',hidden = true}):toggle() + end + ''; + options = { + desc = "Open Lazygit"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/treesitter.nix b/home-manager/modules/neovim/plugins/treesitter.nix new file mode 100644 index 0000000..dedaec4 --- /dev/null +++ b/home-manager/modules/neovim/plugins/treesitter.nix @@ -0,0 +1,24 @@ +{...}: { + programs.nixvim = { + plugins = { + treesitter = { + enable = true; + nixvimInjections = true; + + settings = { + indent.enable = true; + }; + }; + + treesitter-context = { + enable = false; + }; + + treesitter-refactor = { + enable = true; + highlightDefinitions.enable = true; + }; + hmts.enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/trouble.nix b/home-manager/modules/neovim/plugins/trouble.nix new file mode 100644 index 0000000..9130c96 --- /dev/null +++ b/home-manager/modules/neovim/plugins/trouble.nix @@ -0,0 +1,108 @@ +{...}: { + programs.nixvim = { + plugins = { + trouble = { + enable = true; + + settings = { + modes = { + preview_split = { + mode = "diagnostics"; + preview = { + type = "split"; + relative = "win"; + position = "right"; + size = 0.5; + }; + }; + + preview_float = { + mode = "diagnostics"; + preview = { + type = "float"; + relative = "editor"; + border = "rounded"; + title = "Preview"; + title_pos = "center"; + position = [ + 0 + (-2) + ]; + size = { + width = 0.3; + height = 0.3; + }; + zindex = 200; + }; + }; + }; + }; + }; + + which-key.settings.spec = [ + { + __unkeyed = "x"; + mode = "n"; + group = " Trouble"; + } + ]; + }; + + keymaps = [ + { + mode = "n"; + key = "xx"; + action = "Trouble preview_split toggle"; + options = { + desc = "Diagnostics toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xX"; + action = "Trouble preview_split toggle filter.buf=0"; + options = { + desc = "Buffer Diagnostics toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "us"; + action = "Trouble symbols toggle focus=false"; + options = { + desc = "Symbols toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xl"; + action = "Trouble lsp toggle focus=false win.position=right"; + options = { + desc = "LSP Definitions / references / ... toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xL"; + action = "Trouble loclist toggle"; + options = { + desc = "Location List toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xQ"; + action = "Trouble qflist toggle"; + options = { + desc = "Quickfix List toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/which-key.nix b/home-manager/modules/neovim/plugins/which-key.nix new file mode 100644 index 0000000..258cd33 --- /dev/null +++ b/home-manager/modules/neovim/plugins/which-key.nix @@ -0,0 +1,17 @@ +{...}: { + programs.nixvim = { + plugins.which-key = { + enable = true; + settings = { + spec = [ + # "m" = "󱋼 Marks"; + # "t" = " Trouble"; + # "w" = " Window"; + # "d" = " Dap"; + # "n" = " Neorg"; + # "l" = "󰒋 Lsp"; + ]; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/yazi.nix b/home-manager/modules/neovim/plugins/yazi.nix new file mode 100644 index 0000000..f31c548 --- /dev/null +++ b/home-manager/modules/neovim/plugins/yazi.nix @@ -0,0 +1,21 @@ +{...}: { + programs.nixvim = { + plugins.yazi.enable = true; + + keymaps = [ + { + mode = "n"; + key = "e"; + action.__raw = '' + function() + require('yazi').yazi() + end + ''; + options = { + desc = "Yazi toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/yazi.nix b/home-manager/modules/yazi.nix new file mode 100644 index 0000000..ebd5e04 --- /dev/null +++ b/home-manager/modules/yazi.nix @@ -0,0 +1,56 @@ +{pkgs, ...}: let + plugins-repo = pkgs.fetchFromGitHub { + owner = "yazi-rs"; + repo = "plugins"; + rev = "a3ee7173bff700214bc2d993ef605c3c41d800c9"; + hash = "sha256-m2A/vIgGMzFzhaOgFL21cZua8h2XaYu7Jb6yuZQKiTw="; + }; +in { + programs.yazi = { + enable = true; + enableZshIntegration = true; + shellWrapperName = "y"; + + settings = { + manager = { + show_hidden = true; + }; + preview = { + max_width = 1000; + max_height = 1000; + }; + }; + + plugins = { + chmod = "${plugins-repo}/chmod.yazi"; + full-border = "${plugins-repo}/full-border.yazi"; + max-preview = "${plugins-repo}/max-preview.yazi"; + starship = pkgs.fetchFromGitHub { + owner = "Rolv-Apneseth"; + repo = "starship.yazi"; + rev = "dc9989c2bdd3d04e615d3bbb5f3bf99ed6ce1a35"; + sha256 = "sha256-AwBqOKWtz5BzY7Sye1JljWI2t+JQGGQfOT6oQN7YTOg="; + }; + }; + + initLua = '' + require("full-border"):setup() + require("starship"):setup() + ''; + + keymap = { + manager.prepend_keymap = [ + { + on = "T"; + run = "plugin --sync max-preview"; + desc = "Maximize or restore the preview pane"; + } + { + on = ["c" "m"]; + run = "plugin chmod"; + desc = "Chmod on selected files"; + } + ]; + }; + }; +} diff --git a/wallpapers/ai.png b/wallpapers/ai.png new file mode 100644 index 0000000..1cd2ed9 Binary files /dev/null and b/wallpapers/ai.png differ diff --git a/wallpapers/classic.jpg b/wallpapers/classic.jpg new file mode 100644 index 0000000..e9bfda9 Binary files /dev/null and b/wallpapers/classic.jpg differ diff --git a/wallpapers/night.jpg b/wallpapers/night.jpg new file mode 100644 index 0000000..a0feb99 Binary files /dev/null and b/wallpapers/night.jpg differ diff --git a/wallpapers/nix-black-4k.png b/wallpapers/nix-black-4k.png new file mode 100644 index 0000000..c1f20a2 Binary files /dev/null and b/wallpapers/nix-black-4k.png differ