mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
modules/files: fix module
This commit is contained in:
parent
6b6de34c22
commit
89b472606d
1 changed files with 29 additions and 22 deletions
|
@ -2,31 +2,38 @@ modules: {
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
helpers,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) types;
|
inherit (lib) types;
|
||||||
fileModuleType = types.submodule ({
|
fileModuleType = types.submoduleWith {
|
||||||
name,
|
shorthandOnlyDefinesConfig = true;
|
||||||
config,
|
specialArgs.helpers = helpers;
|
||||||
...
|
modules = [
|
||||||
}: {
|
({
|
||||||
imports = modules;
|
name,
|
||||||
options.plugin = lib.mkOption {
|
config,
|
||||||
type = types.package;
|
...
|
||||||
description = "A derivation with the content of the file in it";
|
}: {
|
||||||
readOnly = true;
|
imports = modules;
|
||||||
internal = true;
|
options.plugin = lib.mkOption {
|
||||||
};
|
type = types.package;
|
||||||
config = {
|
description = "A derivation with the content of the file in it";
|
||||||
path = name;
|
readOnly = true;
|
||||||
type = lib.mkDefault (
|
internal = true;
|
||||||
if lib.hasSuffix ".vim" name
|
};
|
||||||
then "vim"
|
config = {
|
||||||
else "lua"
|
path = name;
|
||||||
);
|
type = lib.mkDefault (
|
||||||
plugin = pkgs.writeTextDir config.path config.content;
|
if lib.hasSuffix ".vim" name
|
||||||
};
|
then "vim"
|
||||||
});
|
else "lua"
|
||||||
|
);
|
||||||
|
plugin = pkgs.writeTextDir config.path config.content;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
files = lib.mkOption {
|
files = lib.mkOption {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue