flake-parts/setups/nixvim: add branch option

This commit is contained in:
Gabriel Arazas 2024-06-10 13:25:03 +08:00
parent ef2927ee32
commit 4590be0d3d
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -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