mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
wrappers: move programs.nixvim
declaration to _shared.nix
This commit is contained in:
parent
af650ba940
commit
e1c0b52487
4 changed files with 14 additions and 25 deletions
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
# Extra args for the `evalNixvim` call that produces the type for `programs.nixvim`
|
||||
evalArgs ? { },
|
||||
# Option path where extraFiles should go
|
||||
filesOpt ? null,
|
||||
# Filepath prefix to apply to extraFiles
|
||||
|
@ -26,11 +28,17 @@ let
|
|||
setAttrByPath
|
||||
;
|
||||
cfg = config.programs.nixvim;
|
||||
nixvimConfiguration = config.lib.nixvim.modules.evalNixvim evalArgs;
|
||||
extraFiles = lib.filter (file: file.enable) (lib.attrValues cfg.extraFiles);
|
||||
in
|
||||
{
|
||||
_file = ./_shared.nix;
|
||||
|
||||
options.programs.nixvim = lib.mkOption {
|
||||
inherit (nixvimConfiguration) type;
|
||||
default = { };
|
||||
};
|
||||
|
||||
# TODO: Added 2024-07-24; remove after 24.11
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule
|
||||
|
|
|
@ -16,7 +16,7 @@ let
|
|||
types
|
||||
;
|
||||
cfg = config.programs.nixvim;
|
||||
nixvimConfig = config.lib.nixvim.modules.evalNixvim {
|
||||
evalArgs = {
|
||||
extraSpecialArgs = {
|
||||
darwinConfig = config;
|
||||
};
|
||||
|
@ -28,14 +28,7 @@ in
|
|||
{
|
||||
_file = ./darwin.nix;
|
||||
|
||||
options = {
|
||||
programs.nixvim = mkOption {
|
||||
inherit (nixvimConfig) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ (import ./_shared.nix { }) ];
|
||||
imports = [ (import ./_shared.nix { inherit evalArgs; }) ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
|
|
|
@ -15,7 +15,7 @@ let
|
|||
types
|
||||
;
|
||||
cfg = config.programs.nixvim;
|
||||
nixvimConfig = config.lib.nixvim.modules.evalNixvim {
|
||||
evalArgs = {
|
||||
extraSpecialArgs = {
|
||||
hmConfig = config;
|
||||
};
|
||||
|
@ -27,15 +27,9 @@ in
|
|||
{
|
||||
_file = ./hm.nix;
|
||||
|
||||
options = {
|
||||
programs.nixvim = mkOption {
|
||||
inherit (nixvimConfig) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit evalArgs;
|
||||
filesOpt = [
|
||||
"xdg"
|
||||
"configFile"
|
||||
|
|
|
@ -16,7 +16,7 @@ let
|
|||
types
|
||||
;
|
||||
cfg = config.programs.nixvim;
|
||||
nixvimConfig = config.lib.nixvim.modules.evalNixvim {
|
||||
evalArgs = {
|
||||
extraSpecialArgs = {
|
||||
nixosConfig = config;
|
||||
};
|
||||
|
@ -28,15 +28,9 @@ in
|
|||
{
|
||||
_file = ./nixos.nix;
|
||||
|
||||
options = {
|
||||
programs.nixvim = mkOption {
|
||||
inherit (nixvimConfig) type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit evalArgs;
|
||||
filesOpt = [
|
||||
"environment"
|
||||
"etc"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue