From 46872d0f2a9580098f7a7cd590ef85aa13cb11d3 Mon Sep 17 00:00:00 2001 From: Sandro Date: Fri, 28 Jun 2024 23:11:38 +0200 Subject: [PATCH] pkgs: add nixvimWithOptions (#9) Co-authored-by: Marcel --- README.md | 17 +++++++++++++++++ flake.nix | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3350c8..277b139 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ inputs = { { imports = [ inputs.nvim.nixosModules.nvim ]; + # See + # for availabe options. programs.nixvim.enable = true; } ``` @@ -41,6 +43,8 @@ inputs = { { imports = [ inputs.nvim.homeManagerModules.nvim ]; + # See + # for availabe options. programs.nixvim.enable = true; } ``` @@ -52,3 +56,16 @@ inputs = { environment.systemPackages = [ inputs.nvim.packages.x86_64-linux.nixvim ]; } ``` + +```nix +{ + environment.systemPackages = [ + (inputs.nvim.packages.x86_64-linux.nixvimWithOptions { + inherit pkgs; + # See + # for availabe options. + options.enableMan = false; + }) + ]; +} +``` diff --git a/flake.nix b/flake.nix index d42e306..d7a3e7f 100644 --- a/flake.nix +++ b/flake.nix @@ -76,13 +76,18 @@ }; } // flake-utils.lib.eachDefaultSystem (system: { packages = { - nixvim = nixvim.legacyPackages.${system}.makeNixvimWithModule { + nixvimWithOptions = { pkgs, options ? { } } : nixvim.legacyPackages.${system}.makeNixvimWithModule { module = { config, lib, pkgs, ... }: { imports = [ (mkLsp { inherit config lib pkgs; } (angularLsp { inherit pkgs; })) ./modules + options ]; }; + inherit pkgs; + }; + + nixvim = self.packages.${system}.nixvimWithOptions { inherit (nixpkgs.legacyPackages.${system}) pkgs; };