From 4590be0d3de4a595cee8335d3c02c38844332fa7 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 10 Jun 2024 13:25:03 +0800 Subject: [PATCH] flake-parts/setups/nixvim: add branch option --- modules/flake-parts/setups/nixvim.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/flake-parts/setups/nixvim.nix b/modules/flake-parts/setups/nixvim.nix index c9a2e5e3..499310ca 100644 --- a/modules/flake-parts/setups/nixvim.nix +++ b/modules/flake-parts/setups/nixvim.nix @@ -11,8 +11,8 @@ let cfg = config.setups.nixvim; nixvimModules = ../../nixvim; - mkNixvimConfig = { system, pkgs, modules ? [ ] }: - inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { + mkNixvimConfig = { system, pkgs, nixvimBranch ? "nixvim", modules ? [ ] }: + inputs.${nixvimBranch}.legacyPackages.${system}.makeNixvimWithModule { inherit pkgs; module = { imports = modules; @@ -47,6 +47,15 @@ let ]; }; + nixvimBranch = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "nixvim"; + example = "nixvim-unstable"; + description = '' + The NixVim branch to be used for the configuration. + ''; + }; + neovimPackages = lib.mkOption { type = with lib.types; functionTo (listOf package); default = pkgs: with pkgs; [ neovim ]; @@ -140,6 +149,7 @@ in "${name}-${nixpkgsBranch}-${neovimPkg.name}" (mkNixvimConfig { inherit system pkgs; + inherit (metadata) nixvimBranch; modules = cfg.sharedModules ++ cfg.standaloneConfigModules