commit dc02604cdfc177ce29e28c66881ac153a5927f8c Author: Prunebutt Date: Fri Nov 21 13:28:35 2025 +0100 basic structure, colorschemes and astrocore diff --git a/config/colorscheme.nix b/config/colorscheme.nix new file mode 100644 index 0000000..2804780 --- /dev/null +++ b/config/colorscheme.nix @@ -0,0 +1,16 @@ +{lib,...}: { + colorscheme = lib.mkOverride 500 "kanagawa"; + + colorschemes = (builtins.listToAttrs + (map + (scheme: { name = scheme; value = {enable = true;};}) + [ + "tokyonight" + "nord" + "rose-pine" + "kanagawa" + "gruvbox" + "everforest" + ]) + ); +} diff --git a/config/core.nix b/config/core.nix new file mode 100644 index 0000000..fbd058b --- /dev/null +++ b/config/core.nix @@ -0,0 +1,3 @@ +{ + enablePrintInit = true; +} diff --git a/config/default.nix b/config/default.nix new file mode 100644 index 0000000..d0582e8 --- /dev/null +++ b/config/default.nix @@ -0,0 +1,12 @@ +{ lib, ...}: let + definitions = lib.attrNames ( + lib.filterAttrs + (filename: kind: + filename != "default.nix" + && (kind == "regular" || kind == "directory") + ) + (builtins.readDir ./.) + ); +in { + imports = map (file: import ./${file}) definitions; +} diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4db3775 --- /dev/null +++ b/default.nix @@ -0,0 +1,23 @@ +_: +{ + imports = [ + ./plugins + ./config + ]; + + config = { + globals.mapleader = " "; + + viAlias = true; + vimAlias = true; + + clipboard = { + providers = { + xsel.enable = true; + wl-copy.enable = true; + }; + + register = "unnamedplus"; + }; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..2f5e976 --- /dev/null +++ b/flake.lock @@ -0,0 +1,217 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1762980239, + "narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "52a2caecc898d0b46b2b905f058ccc5081f842da", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "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_2": { + "inputs": { + "systems": "systems_2" + }, + "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" + } + }, + "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" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1763618868, + "narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1763464769, + "narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6f374686605df381de8541c072038472a5ea2e2d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_2", + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1763717236, + "narHash": "sha256-rJVRoLS+V1X7ge6qiaudG8OxYCiglF9puxm+i9cVPDo=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "a635b5689484279ab552ad211ce318d6d0f7614b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "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" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4a93a5c --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + description = "My nixvim configuration"; + + inputs = { + nixvim.url = "github:nix-community/nixvim"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, nixvim, flake-utils, ... }@inputs: + let + config = import ./config; # import the module directly + in flake-utils.lib.eachDefaultSystem (system: + let + nixvimLib = nixvim.lib.${system}; + pkgs = import nixpkgs { inherit system; }; + nixvim' = nixvim.legacyPackages.${system}; + nvim = nixvim'.makeNixvimWithModule { + inherit pkgs; + module = ./.; + }; + in { + formatter = nixpkgs.legacyPackages.${system}.alejandra; + + checks = { + default = nixvimLib.check.mkTestDerivationFromNvim { + inherit nvim; + name = "My nixvim configuration"; + }; + }; + + packages = { + # Lets you run `nix run .` to start nixvim + default = nvim; + }; + + devShells.default = import ./shell.nix { inherit pkgs; }; + }); +} diff --git a/plugins/astrocore.nix b/plugins/astrocore.nix new file mode 100644 index 0000000..6411b99 --- /dev/null +++ b/plugins/astrocore.nix @@ -0,0 +1,38 @@ +{pkgs, lib,...}: let + inherit lib.nixvim.lua.toLuaObject; + + options = { + features = { + large_buf = { size = 1024 * 256; lines = 10000 }; # set global limits for large files for disabling features like treesitter + autopairs = true; # enable autopairs at start + cmp = true; # enable completion at start + diagnostics = { virtual_text = true; virtual_lines = false }; # diagnostic settings on startup + highlighturl = true; # highlight URLs at start + notifications = true; # enable notifications at start + }; + # Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on + diagnostics = { + virtual_text = true; + underline = true; + }; + # passed to `vim.filetype.add` + # filetypes = { + # # see `:h vim.filetype.add` for usage + # extension = { + # foo = "fooscript"; + # }; + # filename = { + # [".foorc"] = "fooscript"; + # }; + # pattern = { + # [".*/etc/foo/.*"] = "fooscript"; + # }; + # }; + }; +in { + extraPlugins = [pkgs.vimPlugins.astrocore]; + + extraConfigLua = /*lua*/ '' + require('astrocore').setup(${toLuaObject options}) + '' +} diff --git a/plugins/default.nix b/plugins/default.nix new file mode 100644 index 0000000..8cfbb04 --- /dev/null +++ b/plugins/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./treesitter.nix + ]; +} diff --git a/plugins/treesitter.nix b/plugins/treesitter.nix new file mode 100644 index 0000000..29117c7 --- /dev/null +++ b/plugins/treesitter.nix @@ -0,0 +1,19 @@ +{ + plugins = { + treesitter = { + enable = true; + nixGrammars = true; + settings = { + highlight.enable = true; + indent.enable = true; + }; + }; + + treesitter-context = { + enable = true; + settings.max_lines = 2; + }; + }; + + # rainbow-delimiters.enable = true; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..1182a7e --- /dev/null +++ b/shell.nix @@ -0,0 +1,19 @@ +{ pkgs }: + +pkgs.mkShell { + buildInputs = with pkgs; [ + g++ + gcc + + python3 + + nodejs_24 + + # Rust + cargo + rustc + + # Tools + ripgrep + ]; +}