From 7963190ef1d8069ab7d425c4c6b8b28095e816f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 18 Jan 2025 11:27:40 +0100 Subject: [PATCH 1/4] fix(nvim): conflict with using global packages Now it is an error to override the pkgs if global packages are being used. --- flake-modules/nixos-modules.nix | 17 ++++++----------- flake-modules/nvim.nix | 10 +++------- nvim/default.nix | 4 +--- nvim/standalone.nix | 10 +--------- 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/flake-modules/nixos-modules.nix b/flake-modules/nixos-modules.nix index 2e98ee4..1422669 100644 --- a/flake-modules/nixos-modules.nix +++ b/flake-modules/nixos-modules.nix @@ -2,17 +2,12 @@ { flake.nixosModules = let - nvim-config = - { pkgs, ... }: - { - imports = [ - inputs.nixvim.homeManagerModules.nixvim - (import ../nvim { - inherit (inputs) unstable; - inherit (pkgs) system; - }) - ]; - }; + nvim-config = { + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ../nvim + ]; + }; homeManagerModuleSandalone = import ../home { inherit nvim-config; inherit (inputs) stylix; diff --git a/flake-modules/nvim.nix b/flake-modules/nvim.nix index 78a6732..f5085bc 100644 --- a/flake-modules/nvim.nix +++ b/flake-modules/nvim.nix @@ -3,19 +3,15 @@ flake.overlays.nixvim = inputs.nixvim.overlays.default; perSystem = - { pkgs, system, ... }: + { system, ... }: let nixvimLib = inputs.nixvim.lib.${system}; nixvim = inputs.nixvim.legacyPackages.${system}; testNvimModule = nixvimLib.check.mkTestDerivationFromNixvimModule; nvimModule = extraConfig: { - inherit pkgs; - extraSpecialArgs = { - inherit (inputs) unstable; - inherit system; - }; + pkgs = inputs.unstable.legacyPackages.${system}; module = { - imports = [ (import ../nvim/standalone.nix { standalone = true; }) ]; + imports = [ ../nvim/standalone.nix ]; config = extraConfig; }; }; diff --git a/nvim/default.nix b/nvim/default.nix index 852db55..9a9b212 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -1,4 +1,3 @@ -{ system, unstable }: { lib, config, ... }: let cfg = config.jhome.nvim; @@ -7,9 +6,8 @@ in imports = [ ./options.nix ]; config.programs.nixvim = lib.mkMerge [ - (import ./standalone.nix { standalone = false; }) + (import ./standalone.nix) (lib.mkIf cfg.enable { - nixpkgs = lib.mkForce { pkgs = import unstable { inherit system; }; }; enable = true; defaultEditor = lib.mkDefault true; jhome.nvim = cfg; diff --git a/nvim/standalone.nix b/nvim/standalone.nix index c8184b1..87bde7b 100644 --- a/nvim/standalone.nix +++ b/nvim/standalone.nix @@ -1,11 +1,4 @@ -{ standalone }: -{ - pkgs, - system, - unstable, - lib, - ... -}: +{ pkgs, ... }: { imports = [ ./options.nix @@ -17,7 +10,6 @@ config = { withRuby = false; - nixpkgs = lib.optionalAttrs standalone { pkgs = unstable.legacyPackages.${system}; }; globals.mapleader = " "; # Appearance colorschemes.gruvbox = { From d2babf8808cabff2447592f1ccdf6aedfde81748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 18 Jan 2025 11:45:33 +0100 Subject: [PATCH 2/4] fix(nvim): remove nixd LSP It is now incompatible with Lix. --- nvim/dev-plugins.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/nvim/dev-plugins.nix b/nvim/dev-plugins.nix index 682f400..7659912 100644 --- a/nvim/dev-plugins.nix +++ b/nvim/dev-plugins.nix @@ -15,7 +15,6 @@ let # "html" # Not writing html "jsonls" "marksman" - "nixd" "ruff" "taplo" # "texlab" # Not using it From 09cc4e611004f2214597e565e2813c55cf6affe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 18 Jan 2025 11:48:50 +0100 Subject: [PATCH 3/4] fix(nvim): don't combine plugins unless standalone Its causing errors sadly T-T --- flake-modules/nvim.nix | 7 +++++-- nvim/standalone.nix | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flake-modules/nvim.nix b/flake-modules/nvim.nix index f5085bc..7e5e988 100644 --- a/flake-modules/nvim.nix +++ b/flake-modules/nvim.nix @@ -3,7 +3,7 @@ flake.overlays.nixvim = inputs.nixvim.overlays.default; perSystem = - { system, ... }: + { lib, system, ... }: let nixvimLib = inputs.nixvim.lib.${system}; nixvim = inputs.nixvim.legacyPackages.${system}; @@ -12,7 +12,10 @@ pkgs = inputs.unstable.legacyPackages.${system}; module = { imports = [ ../nvim/standalone.nix ]; - config = extraConfig; + config = lib.mkMerge [ + { performance.combinePlugins.enable = true; } + extraConfig + ]; }; }; moduleDev = nvimModule { }; diff --git a/nvim/standalone.nix b/nvim/standalone.nix index 87bde7b..8e25d9e 100644 --- a/nvim/standalone.nix +++ b/nvim/standalone.nix @@ -42,7 +42,6 @@ # Enable local configuration :h 'exrc' exrc = true; # safe since nvim 0.9 }; - performance.combinePlugins.enable = true; extraPlugins = let plugins = pkgs.vimPlugins; From fb7934e799a8a7ad6f102b586139e1af68f1db44 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 19 Jan 2025 00:00:31 +0100 Subject: [PATCH 4/4] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 6cf149f..bcfaabe 100644 --- a/flake.lock +++ b/flake.lock @@ -281,11 +281,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736916166, - "narHash": "sha256-puPDoVKxkuNmYIGMpMQiK8bEjaACcCksolsG36gdaNQ=", + "lastModified": 1737165118, + "narHash": "sha256-s40Kk/OulP3J/1JvC3VT16U4r/Xw6Qdi7SRw3LYkPWs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e24b4c09e963677b1beea49d411cd315a024ad3a", + "rev": "6a3ae7a5a12fb8cac2d59d7df7cbd95f9b2f0566", "type": "github" }, "original": { @@ -316,11 +316,11 @@ ] }, "locked": { - "lastModified": 1737143193, - "narHash": "sha256-+/BdPFrdJpgmzrMEUZMxsLeND8IvFtjyZbxHX2XrNv4=", + "lastModified": 1737200978, + "narHash": "sha256-QTUx/F8HVjrRIHQxHKrr72aPMj+cDk18WTbvBCCBBdI=", "owner": "nix-community", "repo": "nixvim", - "rev": "aa839cf994f6b9a6b38e755597452087beac0567", + "rev": "cbf960e5659054b2ccf27b67218782e69016bef5", "type": "github" }, "original": {