From e077f0182113860917e0965bd9f652d18d5190ef Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Wed, 5 Mar 2025 16:08:43 -0300 Subject: [PATCH] feat(devkit): add neovim configuration (dot013/nvim) to devkit --- .gitmodules | 3 + flake.lock | 368 ++++++++++---------------------- flake.nix | 51 ++--- flakes/neovim | 1 + modules/home-manager/devkit.nix | 6 +- 5 files changed, 144 insertions(+), 285 deletions(-) create mode 100644 .gitmodules create mode 160000 flakes/neovim diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..459a588 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "flakes/neovim"] + path = flakes/neovim + url = https://forge.capytal.company/dot013/nvim diff --git a/flake.lock b/flake.lock index 013a0d9..8b4df5b 100644 --- a/flake.lock +++ b/flake.lock @@ -104,6 +104,29 @@ "type": "github" } }, + "blink-cmp": { + "inputs": { + "fenix": "fenix", + "flake-parts": "flake-parts", + "nixpkgs": [ + "neovim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741143396, + "narHash": "sha256-u3Lore4Q7CplMziUEAvUvwDU8zInG/QR6ofxe0C1SAY=", + "owner": "Saghen", + "repo": "blink.cmp", + "rev": "ef9d861952bfe29d096c993d4bd69576e09447fe", + "type": "github" + }, + "original": { + "owner": "Saghen", + "repo": "blink.cmp", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1737689766, @@ -121,7 +144,7 @@ }, "devshell": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1735644329, @@ -137,25 +160,26 @@ "type": "github" } }, - "dot013-nvim": { + "fenix": { "inputs": { - "go-grip": "go-grip", - "neovim-nightly-overlay": "neovim-nightly-overlay", "nixpkgs": [ + "neovim", + "blink-cmp", "nixpkgs" - ] + ], + "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1740937686, - "narHash": "sha256-LujUh0RybNz8D1jbltK2Z3Kvirs+VLkrnbY48+1gwkA=", - "owner": "dot013", - "repo": "nvim", - "rev": "7352d5ff2b74b6157b59c56d8d8b7fb3e01f1e0d", + "lastModified": 1734676450, + "narHash": "sha256-iwcxhTVe4h5TqW0HsNiOQP27eMBmbBshF+q2UjEy5aU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "46e19fa0eb3260b2c3ee5b2cf89e73343c1296ab", "type": "github" }, "original": { - "owner": "dot013", - "repo": "nvim", + "owner": "nix-community", + "repo": "fenix", "type": "github" } }, @@ -207,52 +231,16 @@ "type": "github" } }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "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": { - "nixpkgs-lib": [ - "dot013-nvim", - "neovim-nightly-overlay", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1740872218, - "narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=", + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3876f6b87db82f33775b1ef5ea343986105db764", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "type": "github" }, "original": { @@ -262,28 +250,6 @@ } }, "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "dot013-nvim", - "neovim-nightly-overlay", - "hercules-ci-effects", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "nixpak", @@ -304,9 +270,9 @@ "type": "github" } }, - "flake-parts_4": { + "flake-parts_3": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1736143030, @@ -378,36 +344,12 @@ } }, "git-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": [ - "dot013-nvim", - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1740870877, - "narHash": "sha256-LWDIJvKWMW0tiih1jTcAK0ncTi3S9IF3gOhpCT1ydik=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "25d4946dfc2021584f5bde1fbd2aa97353384a95", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "git-hooks_2": { "inputs": { "flake-compat": [ "stylix", "flake-compat" ], - "gitignore": "gitignore_2", + "gitignore": "gitignore", "nixpkgs": [ "stylix", "nixpkgs" @@ -428,29 +370,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "dot013-nvim", - "neovim-nightly-overlay", - "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" - } - }, - "gitignore_2": { "inputs": { "nixpkgs": [ "stylix", @@ -472,7 +391,7 @@ "type": "github" } }, - "gitignore_3": { + "gitignore_2": { "inputs": { "nixpkgs": [ "xremap", @@ -515,7 +434,10 @@ "go-grip": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "neovim", + "nixpkgs" + ] }, "locked": { "lastModified": 1733732005, @@ -532,29 +454,6 @@ } }, "hercules-ci-effects": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": [ - "dot013-nvim", - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1739595404, - "narHash": "sha256-0CjCfbq0yHWexOrpO06e2WU1r5JAqR6ffy1zgM3NksI=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "06519cec8fb32d219006da6eacd255504a9996af", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "type": "github" - } - }, - "hercules-ci-effects_2": { "inputs": { "flake-parts": [ "nixpak", @@ -602,7 +501,7 @@ }, "home-manager_2": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1737968762, @@ -692,7 +591,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_4", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_3", "xdph": "xdph" @@ -899,44 +798,26 @@ "type": "github" } }, - "neovim-nightly-overlay": { + "neovim": { "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "git-hooks": "git-hooks", - "hercules-ci-effects": "hercules-ci-effects", - "neovim-src": "neovim-src", - "nixpkgs": "nixpkgs_2", - "treefmt-nix": "treefmt-nix" + "blink-cmp": "blink-cmp", + "go-grip": "go-grip", + "nixpkgs": [ + "nixpkgs-unstable" + ] }, "locked": { - "lastModified": 1740874225, - "narHash": "sha256-sdBT6Njf1MDVnb4kLbGhCpXQ2P7E+50TRW1mIdujFEE=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "ee3854351ae89ad79eb148d4253263aeaa936913", - "type": "github" + "lastModified": 1741201430, + "narHash": "sha256-FZguj+Fqt4iAccqEbr8RvNhTghFILyi2GYpEF/1/iAo=", + "ref": "refs/heads/main", + "rev": "71dede35503067d0b0ba8c8145e7573708e232f9", + "revCount": 106, + "type": "git", + "url": "https://forge.capytal.company/dot013/nvim" }, "original": { - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "neovim-src": { - "flake": false, - "locked": { - "lastModified": 1740870130, - "narHash": "sha256-nrKnJhmplq4QMcenY/bpD6SHOsiN3VS2toUtsO9NfII=", - "owner": "neovim", - "repo": "neovim", - "rev": "13513835798c732554de277229d4c6744df11502", - "type": "github" - }, - "original": { - "owner": "neovim", - "repo": "neovim", - "type": "github" + "type": "git", + "url": "https://forge.capytal.company/dot013/nvim" } }, "nix-flatpak": { @@ -957,8 +838,8 @@ }, "nixpak": { "inputs": { - "flake-parts": "flake-parts_3", - "hercules-ci-effects": "hercules-ci-effects_2", + "flake-parts": "flake-parts_2", + "hercules-ci-effects": "hercules-ci-effects", "nixpkgs": [ "nixpkgs" ] @@ -979,21 +860,33 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728241625, - "narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=", + "lastModified": 1740339700, + "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1", + "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-lib": { + "locked": { + "lastModified": 1733096140, + "narHash": "sha256-1qRH7uAUsyQI7R1Uwl4T+XvdNv778H0Nb5njNrqvylY=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" + } + }, + "nixpkgs-lib_2": { "locked": { "lastModified": 1735774519, "narHash": "sha256-CewEm1o2eVAnoqb6Ml+Qi9Gg/EfNAxbRx1lANGVyoLI=", @@ -1022,38 +915,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1740791350, - "narHash": "sha256-igS2Z4tVw5W/x3lCZeeadt0vcU9fxtetZ/RyrqsCRQ0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "199169a2135e6b864a888e89a2ace345703c025d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1740339700, - "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { "locked": { "lastModified": 1722073938, "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", @@ -1069,7 +930,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_3": { "locked": { "lastModified": 1737746512, "narHash": "sha256-nU6AezEX4EuahTO1YopzueAXfjFfmCHylYEFCagduHU=", @@ -1085,7 +946,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_4": { "locked": { "lastModified": 1737885589, "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", @@ -1101,7 +962,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_5": { "locked": { "lastModified": 1735554305, "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", @@ -1119,8 +980,8 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_4", - "gitignore": "gitignore_3", + "flake-compat": "flake-compat_2", + "gitignore": "gitignore_2", "nixpkgs": [ "xremap", "hyprland", @@ -1143,17 +1004,34 @@ }, "root": { "inputs": { - "dot013-nvim": "dot013-nvim", "home-manager": "home-manager", + "neovim": "neovim", "nix-flatpak": "nix-flatpak", "nixpak": "nixpak", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", "stylix": "stylix", "xremap": "xremap" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1734622712, + "narHash": "sha256-2Oc2LbFypF1EG3zTVIVcuT5XFJ7R3oAwu2tS8B0qQ0I=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "fe027d79d22f2a7645da4143f5cc0f5f56239b97", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "sops-nix": { "inputs": { "nixpkgs": [ @@ -1181,9 +1059,9 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat", "flake-utils": "flake-utils_2", - "git-hooks": "git-hooks_2", + "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": [ "home-manager" @@ -1308,29 +1186,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": [ - "dot013-nvim", - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1739829690, - "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "3d0579f5cc93436052d94b73925b48973a104204", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "treefmt-nix_2": { - "inputs": { - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1738070913, @@ -1397,13 +1253,13 @@ "inputs": { "crane": "crane", "devshell": "devshell", - "flake-parts": "flake-parts_4", + "flake-parts": "flake-parts_3", "home-manager": "home-manager_2", "hyprland": "hyprland", "nixpkgs": [ "nixpkgs" ], - "treefmt-nix": "treefmt-nix_2", + "treefmt-nix": "treefmt-nix", "xremap": "xremap_2" }, "locked": { diff --git a/flake.nix b/flake.nix index dd43373..f8f4d14 100644 --- a/flake.nix +++ b/flake.nix @@ -33,11 +33,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - # Dependecy of the Neovim configuration at ./modules/home-manager/devenv.nix - dot013-nvim = { - url = "github:dot013/nvim"; - # url = "git+file:///home/guz/.projects/dot013-nvim"; - inputs.nixpkgs.follows = "nixpkgs"; + neovim = { + url = "git+https://forge.capytal.company/dot013/nvim"; + inputs.nixpkgs.follows = "nixpkgs-unstable"; }; }; @@ -125,29 +123,32 @@ pkgs, ... }: { - devkit = import ./packages/devkit {inherit pkgs inputs;}; + neovim = inputs.neovim.packages.${pkgs.system}.default; + + devkit = + (import ./packages/devkit {inherit pkgs inputs;}) + // { + neovim = self.packages.${pkgs.system}.neovim; + }; devkit-shell = let devkit = self.packages.${pkgs.system}.devkit; - packages = - (with devkit; [ - git - lazygit - starship - tmux - yazi - zellij - zsh - ]) - ++ [ - inputs.dot013-nvim.packages.${pkgs.system}.default + packages = with devkit; [ + git + lazygit + neovim + starship + tmux + yazi + zellij + zsh - # Useful on new Nix installations - (pkgs.writeShellScriptBin "nix" '' - ${lib.getExe pkgs.nix} \ - --experimental-features 'nix-command flakes' \ - "$@" - '') - ]; + # Useful on new Nix installations + (pkgs.writeShellScriptBin "nix" '' + ${lib.getExe pkgs.nix} \ + --experimental-features 'nix-command flakes' \ + "$@" + '') + ]; in pkgs.writeShellScriptBin "devkit-shell" '' export PATH="$PATH:${lib.makeBinPath packages}" diff --git a/flakes/neovim b/flakes/neovim new file mode 160000 index 0000000..71dede3 --- /dev/null +++ b/flakes/neovim @@ -0,0 +1 @@ +Subproject commit 71dede35503067d0b0ba8c8145e7573708e232f9 diff --git a/modules/home-manager/devkit.nix b/modules/home-manager/devkit.nix index 7cef5be..4eb092c 100644 --- a/modules/home-manager/devkit.nix +++ b/modules/home-manager/devkit.nix @@ -10,9 +10,6 @@ devkitPkgs = self.packages.${pkgs.system}.devkit; in { - imports = [ - inputs.dot013-nvim.homeManagerModules.neovim - ]; options.devkit = with lib; { enable = mkEnableOption "Enable devkit configuration and packages"; @@ -118,7 +115,8 @@ in { }; ## Neovim (Editor) - ## programs.neovim.enable = true; # Already enabled by dot013-nvim + programs.neovim.enable = true; # Already enabled by dot013-nvim + programs.neovim.package = devkitPkgs.neovim; ## Starship (Shell decoration) programs.starship = lib.mkIf cfg.starship.enable {