mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-27 14:15:54 +02:00
modules/files: move submodule to its own file
This commit is contained in:
parent
2deb61f6a5
commit
f5ba05ec82
3 changed files with 25 additions and 18 deletions
|
@ -6,7 +6,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../.
|
../.
|
||||||
./files.nix
|
./files
|
||||||
./output.nix
|
./output.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,23 +14,8 @@ let
|
||||||
defaultPkgs = pkgs;
|
defaultPkgs = pkgs;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
(
|
../../.
|
||||||
{ name, config, ... }:
|
./submodule.nix
|
||||||
{
|
|
||||||
imports = [ ../. ];
|
|
||||||
options.plugin = lib.mkOption {
|
|
||||||
type = types.package;
|
|
||||||
description = "A derivation with the content of the file in it";
|
|
||||||
readOnly = true;
|
|
||||||
internal = true;
|
|
||||||
};
|
|
||||||
config = {
|
|
||||||
path = name;
|
|
||||||
type = lib.mkDefault (if lib.hasSuffix ".vim" name then "vim" else "lua");
|
|
||||||
plugin = pkgs.writeTextDir config.path config.content;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
22
modules/top-level/files/submodule.nix
Normal file
22
modules/top-level/files/submodule.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
plugin = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
description = "A derivation with the content of the file in it";
|
||||||
|
readOnly = true;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
path = name;
|
||||||
|
type = lib.mkDefault (if lib.hasSuffix ".vim" name then "vim" else "lua");
|
||||||
|
plugin = pkgs.writeTextDir config.path config.content;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue