modules/files: move submodule to its own file

This commit is contained in:
Matt Sturgeon 2024-07-05 16:48:46 +01:00
parent 2deb61f6a5
commit f5ba05ec82
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 25 additions and 18 deletions

View file

@ -6,7 +6,7 @@
{
imports = [
../.
./files.nix
./files
./output.nix
];
}

View file

@ -14,23 +14,8 @@ let
defaultPkgs = pkgs;
};
modules = [
(
{ name, config, ... }:
{
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;
};
}
)
../../.
./submodule.nix
];
};
in

View 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;
};
}