wrappers: move programs.nixvim declaration to _shared.nix

This commit is contained in:
Matt Sturgeon 2024-10-11 00:23:40 +01:00
parent af650ba940
commit e1c0b52487
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 14 additions and 25 deletions

View file

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

View file

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

View file

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

View file

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