From f6d0e6a52036558007b8509d58f6065974b8dffe Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Wed, 5 Mar 2025 18:07:04 -0300 Subject: [PATCH] feat(neovim,devkit): use neovim homeManagerModule --- flake.lock | 52 +++++++++++++++++++++------------ flake.nix | 6 +++- flakes/neovim | 2 +- modules/home-manager/devkit.nix | 14 +++++---- 4 files changed, 47 insertions(+), 27 deletions(-) diff --git a/flake.lock b/flake.lock index 8b4df5b..d72d641 100644 --- a/flake.lock +++ b/flake.lock @@ -144,7 +144,7 @@ }, "devshell": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1735644329, @@ -501,7 +501,7 @@ }, "home-manager_2": { "inputs": { - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1737968762, @@ -591,7 +591,7 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "pre-commit-hooks": "pre-commit-hooks", "systems": "systems_3", "xdph": "xdph" @@ -802,16 +802,14 @@ "inputs": { "blink-cmp": "blink-cmp", "go-grip": "go-grip", - "nixpkgs": [ - "nixpkgs-unstable" - ] + "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1741201430, - "narHash": "sha256-FZguj+Fqt4iAccqEbr8RvNhTghFILyi2GYpEF/1/iAo=", + "lastModified": 1741207158, + "narHash": "sha256-ZBI10bDhMC4OBBogR1kZk3Axmt62rRZsUZk0/OmpHVM=", "ref": "refs/heads/main", - "rev": "71dede35503067d0b0ba8c8145e7573708e232f9", - "revCount": 106, + "rev": "1edf9524e3719406d9bb92a11b3527e3a8b869ba", + "revCount": 112, "type": "git", "url": "https://forge.capytal.company/dot013/nvim" }, @@ -860,16 +858,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740339700, - "narHash": "sha256-cbrw7EgQhcdFnu6iS3vane53bEagZQy/xyIkDWpCgVE=", + "lastModified": 1740828860, + "narHash": "sha256-cjbHI+zUzK5CPsQZqMhE3npTyYFt9tJ3+ohcfaOF/WM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "04ef94c4c1582fd485bbfdb8c4a8ba250e359195", + "rev": "303bd8071377433a2d8f76e684ec773d70c5b642", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -915,6 +913,22 @@ } }, "nixpkgs_2": { + "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_3": { "locked": { "lastModified": 1722073938, "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", @@ -930,7 +944,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1737746512, "narHash": "sha256-nU6AezEX4EuahTO1YopzueAXfjFfmCHylYEFCagduHU=", @@ -946,7 +960,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1737885589, "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", @@ -962,7 +976,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1735554305, "narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=", @@ -1008,7 +1022,7 @@ "neovim": "neovim", "nix-flatpak": "nix-flatpak", "nixpak": "nixpak", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable", "sops-nix": "sops-nix", "stylix": "stylix", @@ -1186,7 +1200,7 @@ }, "treefmt-nix": { "inputs": { - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1738070913, diff --git a/flake.nix b/flake.nix index f8f4d14..da09602 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,6 @@ neovim = { url = "git+https://forge.capytal.company/dot013/nvim"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; }; }; @@ -113,8 +112,13 @@ }; }; + nixosModules = { + neovim = inputs.neovim.nixosModules.default; + }; + homeManagerModules = { devkit = ./modules/home-manager/devkit.nix; + neovim = inputs.neovim.homeManagerModules.default; eww = ./modules/home-manager/eww.nix; }; diff --git a/flakes/neovim b/flakes/neovim index 71dede3..1edf952 160000 --- a/flakes/neovim +++ b/flakes/neovim @@ -1 +1 @@ -Subproject commit 71dede35503067d0b0ba8c8145e7573708e232f9 +Subproject commit 1edf9524e3719406d9bb92a11b3527e3a8b869ba diff --git a/modules/home-manager/devkit.nix b/modules/home-manager/devkit.nix index 4eb092c..9056613 100644 --- a/modules/home-manager/devkit.nix +++ b/modules/home-manager/devkit.nix @@ -10,6 +10,9 @@ devkitPkgs = self.packages.${pkgs.system}.devkit; in { + imports = [ + self.homeManagerModules.neovim + ]; options.devkit = with lib; { enable = mkEnableOption "Enable devkit configuration and packages"; @@ -25,6 +28,10 @@ in { type = with types; bool; default = cfg.enable; }; + neovim.enable = mkOption { + type = with types; bool; + default = cfg.enable; + }; starship.enable = mkOption { type = with types; bool; default = cfg.enable; @@ -52,7 +59,6 @@ in { ]; home.sessionVariables = { - # EDITOR = "nvim"; # Default editor, already defined by dot013-nvim SHELL = lib.mkIf cfg.zsh.enable "${lib.getExe config.programs.zsh.package}"; TERM = lib.mkIf cfg.ghostty.enable "xterm-ghostty"; TERMINAL = lib.mkIf cfg.ghostty.enable "${lib.getExe config.programs.ghostty.package}"; @@ -115,8 +121,7 @@ in { }; ## Neovim (Editor) - programs.neovim.enable = true; # Already enabled by dot013-nvim - programs.neovim.package = devkitPkgs.neovim; + neovim.enable = cfg.neovim.enable; ## Starship (Shell decoration) programs.starship = lib.mkIf cfg.starship.enable { @@ -133,9 +138,6 @@ in { }; # Zellij (Terminal multiplexer) - - # CURRENTLY BORKED https://github.com/zellij-org/zellij/issues/3970 - programs.zellij = lib.mkIf cfg.zellij.enable { enable = true; package = devkitPkgs.zellij;