From 7597d9891d50128295272292badb1fc960ff595b Mon Sep 17 00:00:00 2001 From: fwastring Date: Sun, 30 Nov 2025 23:04:31 +0100 Subject: [PATCH] added nixvim! --- flake.lock | 152 ++++++++++++- flake.nix | 6 + maskiner/core/configuration.nix | 11 - maskiner/legacy/configuration.nix | 9 +- moduler/lsp.nix | 34 --- moduler/programs/nixvim/default.nix | 325 ++++++++++++++++++++++++++++ secrets/sops.yaml | 6 +- 7 files changed, 489 insertions(+), 54 deletions(-) delete mode 100644 moduler/lsp.nix create mode 100644 moduler/programs/nixvim/default.nix diff --git a/flake.lock b/flake.lock index eb70baf..f1cb8db 100644 --- a/flake.lock +++ b/flake.lock @@ -212,6 +212,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -252,7 +273,25 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems_4" + "systems": "systems_3" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_6" }, "locked": { "lastModified": 1731533236, @@ -634,6 +673,34 @@ "type": "github" } }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754860581, + "narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.1.1", + "repo": "ixx", + "type": "github" + } + }, "minimal-tmux": { "inputs": { "nixpkgs": [ @@ -802,6 +869,29 @@ "type": "github" } }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_4" + }, + "locked": { + "lastModified": 1764238240, + "narHash": "sha256-7Znm3koZ4sF+O41Y7rJqf651BPEbjIUYF3r9H23GRGw=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "f1e07ba53abd0fb4872a365cba45562144ad6130", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, "nur": { "inputs": { "flake-parts": [ @@ -827,6 +917,29 @@ "type": "github" } }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_2", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761730856, + "narHash": "sha256-t1i5p/vSWwueZSC0Z2BImxx3BjoUDNKyC2mk24krcMY=", + "owner": "NuschtOS", + "repo": "search", + "rev": "e29de6db0cb3182e9aee75a3b1fd1919d995d85b", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat", @@ -860,6 +973,7 @@ "minimal-tmux": "minimal-tmux", "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": "nixpkgs_6", + "nixvim": "nixvim", "sops-nix": "sops-nix", "stylix": "stylix", "typsite": "typsite" @@ -910,13 +1024,13 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" ], "nur": "nur", - "systems": "systems_3", + "systems": "systems_5", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -997,6 +1111,36 @@ "type": "github" } }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "tinted-foot": { "flake": false, "locked": { @@ -1080,7 +1224,7 @@ }, "typsite": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ], diff --git a/flake.nix b/flake.nix index b656b22..27e0bfb 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,10 @@ url = "github:niksingh710/minimal-tmux-status"; inputs.nixpkgs.follows = "nixpkgs"; }; + nixvim = { + url = "github:nix-community/nixvim"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -39,6 +43,7 @@ catppuccin, confetti, bbk, + nixvim, ... }@inputs: let @@ -59,6 +64,7 @@ catppuccin.nixosModules.catppuccin confetti.nixosModules.default bbk.nixosModules.default + nixvim.nixosModules.default ]; }; node = nixpkgs.lib.nixosSystem { diff --git a/maskiner/core/configuration.nix b/maskiner/core/configuration.nix index e2eaadb..e07f853 100644 --- a/maskiner/core/configuration.nix +++ b/maskiner/core/configuration.nix @@ -20,7 +20,6 @@ in ../../moduler/programs.nix ../../moduler/system.nix ../../moduler/dev.nix - ../../moduler/lsp.nix ../../moduler/hyprland.nix ../../moduler/sound.nix ../../moduler/programs/kubernetes-tools.nix @@ -35,15 +34,6 @@ in base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${theme}.yaml"; }; - programs.ssh.knownHosts = { - desktop = { - extraHostNames = [ "192.168.1.227" ]; - publicKeyFile = ../../keys/rsa_pubkey; - }; - "192.168.1.227" = { - publicKeyFile = ../../keys/rsa_pubkey; - }; - }; hyprland = { enable = true; theme = theme; @@ -90,7 +80,6 @@ in accent = "peach"; }; }; - programs.ranger.enable = true; stylix.targets = { lazygit.enable = false; fish.enable = false; diff --git a/maskiner/legacy/configuration.nix b/maskiner/legacy/configuration.nix index fe89677..58cb295 100644 --- a/maskiner/legacy/configuration.nix +++ b/maskiner/legacy/configuration.nix @@ -24,11 +24,11 @@ in ../../moduler/programs.nix ../../moduler/system.nix ../../moduler/dev.nix - ../../moduler/lsp.nix ../../moduler/hyprland.nix ../../moduler/sound.nix ../../moduler/programs/kubernetes-tools.nix ../../moduler/programs/confetti + ../../moduler/programs/nixvim ]; kubernetes-tools.enable = true; @@ -44,6 +44,11 @@ in base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${theme}.yaml"; }; + nixvim = { + enable = true; + theme = theme; + }; + programs.ssh.knownHosts = { desktop = { extraHostNames = [ "192.168.1.227" ]; @@ -119,7 +124,7 @@ in ]; services.upower = { - enable = true; + enable = true; }; boot.kernelPackages = pkgs.linuxPackages_latest; diff --git a/moduler/lsp.nix b/moduler/lsp.nix deleted file mode 100644 index 779dd05..0000000 --- a/moduler/lsp.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: -{ - options = { - typescript.enable = lib.mkEnableOption "enables kubernetes-tools"; - }; - - config = lib.mkIf config.kubernetes-tools.enable { - environment.systemPackages = with pkgs; [ - nixd - gopls - omnisharp-roslyn - dockerfile-language-server - bash-language-server - helm-ls - yaml-language-server - lua-language-server - marksman - tofu-ls - - # nodejs_22 - # vue-language-server - # vtsls - # typescript - # typescript-language-server - # nodePackages.vscode-json-languageserver - # tailwindcss-language-server - ]; - }; -} diff --git a/moduler/programs/nixvim/default.nix b/moduler/programs/nixvim/default.nix new file mode 100644 index 0000000..93e41fa --- /dev/null +++ b/moduler/programs/nixvim/default.nix @@ -0,0 +1,325 @@ +{ + config, + inputs, + pkgs, + lib, + ... +}: + +let +in +with lib; +{ + options = { + nixvim = { + enable = mkEnableOption "enable k9s"; + theme = mkOption { + type = types.str; + default = "latte"; + description = "Catppuccin theme variant for k9s."; + }; + lsp_jobb = mkEnableOption "enable jobb lsps"; + }; + }; + + config = mkIf config.nixvim.enable { + programs.nixvim = { + enable = true; + + package = inputs.neovim-nightly-overlay.packages.${pkgs.stdenv.hostPlatform.system}.default; + colorschemes = { + catppuccin = { + enable = true; + settings = { + flavour = config.nixvim.theme; + }; + }; + }; + + ################################# + ## Neovim options + ################################# + opts = { + number = true; + relativenumber = true; + signcolumn = "yes"; + tabstop = 4; + shiftwidth = 4; + swapfile = false; + wrap = true; + termguicolors = true; + winborder = "rounded"; + }; + clipboard.register = "unnamedplus"; + + globals.mapleader = " "; + + ################################# + ## Keymaps + ################################# + keymaps = [ + # Telescope + { + mode = "n"; + key = "f"; + action = "Telescope find_files"; + } + { + mode = "n"; + key = "o"; + action = "Telescope live_grep"; + } + + # Substitute + { + mode = "n"; + key = "s"; + action = "lua require('substitute').operator()"; + } + { + mode = "n"; + key = "ss"; + action = "lua require('substitute').line()"; + } + { + mode = "n"; + key = "S"; + action = "lua require('substitute').eol()"; + } + { + mode = "x"; + key = "s"; + action = "lua require('substitute').visual()"; + } + + # LSP + { + mode = "n"; + key = "lf"; + action = "lua vim.lsp.buf.format()"; + } + { + mode = "n"; + key = "gg"; + action = "LazyGit"; + } + + # Navigation fixes for wrap + { + mode = "n"; + key = "j"; + action = "gj"; + options.silent = true; + } + { + mode = "n"; + key = "k"; + action = "gk"; + options.silent = true; + } + + # Buffers + { + mode = "n"; + key = ""; + action = ":bnext"; + } + { + mode = "n"; + key = ""; + action = ":bprevious"; + } + { + mode = "n"; + key = "c"; + action = ":bdelete"; + } + + # Window movement + { + mode = "n"; + key = ""; + action = "wincmd k"; + } + { + mode = "n"; + key = ""; + action = "wincmd j"; + } + { + mode = "n"; + key = ""; + action = "wincmd h"; + } + { + mode = "n"; + key = ""; + action = "wincmd l"; + } + + # Save / quit + { + mode = "n"; + key = "w"; + action = ":w"; + } + { + mode = "n"; + key = "q"; + action = ":qa"; + } + + # Oil + { + mode = "n"; + key = "-"; + action = "Oil"; + } + { + mode = "n"; + key = "h"; + action = "Oil"; + } + ]; + + ################################# + ## Plugins + ################################# + plugins = { + web-devicons.enable = true; + + lualine = { + enable = true; + + settings = { + options.theme = "catppuccin"; + tabline = { + lualine_a = [ "mode" ]; + lualine_b = [ + "branch" + "diagnostics" + ]; + lualine_y = [ "buffers" ]; + }; + sections = { + lualine_a = []; + lualine_b = []; + lualine_c = []; + lualine_x = []; + lualine_y = []; + lualine_z = []; + }; + }; + }; + + treesitter = { + enable = true; + + grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + bash + json + lua + make + markdown + helm + nix + regex + toml + vim + vimdoc + xml + yaml + ]; + }; + oil = { + enable = true; + settings = { + default_file_explorer = true; + columns = [ "icon" ]; + win_options = { + wrap = false; + signcolumn = "no"; + }; + }; + }; + + auto-session.enable = true; + + comment.enable = true; + which-key.enable = true; + nvim-autopairs.enable = true; + vim-surround.enable = true; + + lazygit.enable = true; + + telescope.enable = true; + luasnip.enable = true; + + cmp = { + enable = true; + + settings = { + mapping = { + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + }; + sources = [ + { name = "nvim_lsp"; } + { name = "luasnip"; } + ]; + }; + }; + lsp = { + enable = true; + servers = { + gopls.enable = true; + nixd.enable = true; + lua_ls.enable = true; + bashls.enable = true; + + tinymist.enable = true; + tinymist.settings.formatterMode = "typstyle"; + + yamlls.enable = true; + jsonls.enable = true; + ts_ls.enable = true; + helm_ls.enable = true; + + nginx_language_server.enable = config.nixvim.lsp_jobb; + dockerls.enable = config.nixvim.lsp_jobb; + docker_compose_language_service.enable = config.nixvim.lsp_jobb; + omnisharp.enable = config.nixvim.lsp_jobb; + }; + }; + }; + enableMan = false; + + ################################# + ## LSP + ################################# + ################################# + ## Autocommands + ################################# + autoCmd = [ + { + event = [ + "BufRead" + "BufNewFile" + ]; + pattern = "*.{md,typ}"; + callback = "vim.opt_local.spell = true"; + } + ]; + + ################################# + ## Colorscheme + ################################# + }; + + }; +} diff --git a/secrets/sops.yaml b/secrets/sops.yaml index 868f185..78e5b6e 100644 --- a/secrets/sops.yaml +++ b/secrets/sops.yaml @@ -6,7 +6,7 @@ smtp_password: ENC[AES256_GCM,data:h1K973qeehIIATdoqFhrLiY7XiU=,iv:ltrsG9KZ8rQuS forgejo-admin-password: ENC[AES256_GCM,data:FuDfqjeQ2T5KcOO1BQ==,iv:ueX7XjbiChuwfYm1B/MJvJaYdWbCmoIs91lj9h9uFYE=,tag:qUszDTRZklwSKrS0PpJhTA==,type:str] forgejo-runner-token: ENC[AES256_GCM,data:1AUeTy5Sqoa4u5L/TGjt/v69p2xF/mp0oXVv08TA+squzRVW9/t40xfY2yD8HQ==,iv:uWf9jKIIsajh362vY2NBw8od+iOFGfIQ7NJVFgjWlBw=,tag:hCOzvSKoDbKCGceqNkRx7g==,type:str] gotify_password: ENC[AES256_GCM,data:Tl9T9yxKSyiemmc5B7kCdwYYHB9anenBg8epFNGqu7sa8YfaZNH9HfTdBtqELIcAkkyfoJUj9tOhxcfa1lDasahJC/8VF0jx6tjsgmTJORAwQa/8,iv:bEtG/ICTqqK3E+YXysDLV/uyawoeILKH+mQXTLOcWpk=,tag:dPqm74eH/Gt9Eg0lv2ptEw==,type:str] -user-password: ENC[AES256_GCM,data:cngHqB2IQXVvSMwm5KJeq6wOQMQ4z/DWap3YMyahq2fz8R2CKHackaNY4K3dltXKSLv5zdelyHMf4u7gzuPTMO1yNRIG99C9Yg==,iv:6WZ/dUQwn6+TPXnSEvDVS0DZz0oz7vMvKAioqYzvf0c=,tag:xVoCF0L490nZi/xYTI0klw==,type:str] +user-password: ENC[AES256_GCM,data:AHgYvhSrFgbhKWPJ/SX7MSXZXUbl9Yl8swv5q4wK9vZOdpisXsCIoV5f09exa1wkK5qDhC/LXpFmuOBuJ8lWittJJjF7QtLUYl1zGOPWvMX542eiDc9hACynXYE9iHC69kKk19obmNnyKQ==,iv:ZT/JN1aPCKbkxqehjNd7BrlyYtmYWKWsb54YKTaWQpU=,tag:ai8ycC0ymscD88bPjaYwPA==,type:str] sops: age: - recipient: age1jeyw96795qu52swmtkjqgr2w3g4vxc43ckc5r4hlwpje23ptnfwsheah0s @@ -45,7 +45,7 @@ sops: ay84Q2w0NFlVb0FaNkxKN2t1UDVhejgKx+0w5vbpNzCRRaT/wQRO3JGkIbmn+NvE ZI78XtBJvAwAY6P0tm01rC1wRDGA86wCu52CaOH7cro2zDk/ipZe5g== -----END AGE ENCRYPTED FILE----- - lastmodified: "2025-11-23T20:46:06Z" - mac: ENC[AES256_GCM,data:eI8l+uMRZgS4w/73TN6e4b1wrkyhpNj/HKl1+znEmNyybrwdHLBOxu5XZ9cBA9UbFuZm/U3UxhKLiZncu1bWuFT7eS3IcG/G3wVHyPJR1psJ1Gi+zp1455AUhclRXYc9lEqMe34m9LW+JnXcf3LNQAOJOkits45GS35WhFt/6bI=,iv:qmlB/ehisy4Sw9b1mAvstJ/jHZgUhiHDNr6xHp1z57E=,tag:utTSn3qdufYBQP20WQmiwg==,type:str] + lastmodified: "2025-11-23T21:17:26Z" + mac: ENC[AES256_GCM,data:9urXnnJZ0LVtlsLGjCHhOQ9Aa+GzE91xkP4IvNrcMUPF/sNbX+bDWb8yrjAvc8b4txl6lQXUgjIPzfYhXcXA18f+izj5O/7BeLYAqxeeBoEk7NAbuEJnhyA0KqcJGIblTW3rJW5vM4FhS85lcg6Vaq0Nu2zS3uKf7Yufllomn9E=,iv:cOINahNQ7JHJXiuZ4CGr/pwxpKihLee6+qA9w7uJvLY=,tag:7hhid5XJIMY6+xsV588XWw==,type:str] unencrypted_suffix: _unencrypted version: 3.11.0