flake-parts/setups: add a branch option for NixVim instance submodule

This commit is contained in:
Gabriel Arazas 2024-06-10 12:15:46 +08:00
parent 9e3a95ba24
commit 8f520fa2ad
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
3 changed files with 18 additions and 2 deletions

View File

@ -151,7 +151,7 @@ let
(lib.mkIf (config.nixvim.instance != null) (lib.mkIf (config.nixvim.instance != null)
({ lib, ... }: { ({ lib, ... }: {
imports = [ imports = [
inputs.nixvim.homeManagerModules.nixvim inputs.${config.nixvim.branch}.homeManagerModules.nixvim
]; ];
config.programs.nixvim = { ... }: { config.programs.nixvim = { ... }: {

View File

@ -361,7 +361,7 @@ let
setupConfig = config; setupConfig = config;
in in
{ lib, ... }: { { lib, ... }: {
imports = [ inputs.nixvim.nixosModules.nixvim ]; imports = [ inputs.${config.nixvim.branch}.nixosModules.nixvim ];
programs.nixvim = { ... }: { programs.nixvim = { ... }: {
enable = lib.mkDefault true; enable = lib.mkDefault true;

View File

@ -11,6 +11,22 @@
''; '';
}; };
branch = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "nixvim";
example = "nixvim-stable";
description = ''
The branch of NixVim to be used for the module.
::: {.tip}
A rule of thumb for properly setting up NixVim with the wider-scoped
environment is it should match the nixpkgs version of it. For example,
a NixOS system of `nixos-23.11` nixpkgs branch should be paired with a NixVim
branch of `nixos-23.11`.
:::
'';
};
additionalModules = lib.mkOption { additionalModules = lib.mkOption {
type = with lib.types; listOf raw; type = with lib.types; listOf raw;
default = [ ]; default = [ ];