diff --git a/modules/top-level/default.nix b/modules/top-level/default.nix index d3f6e2c7..bac6bde0 100644 --- a/modules/top-level/default.nix +++ b/modules/top-level/default.nix @@ -6,7 +6,7 @@ { imports = [ ../. - ./files.nix + ./files ./output.nix ]; } diff --git a/modules/top-level/files.nix b/modules/top-level/files/default.nix similarity index 71% rename from modules/top-level/files.nix rename to modules/top-level/files/default.nix index f29b84d3..314be37a 100644 --- a/modules/top-level/files.nix +++ b/modules/top-level/files/default.nix @@ -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 diff --git a/modules/top-level/files/submodule.nix b/modules/top-level/files/submodule.nix new file mode 100644 index 00000000..0de14b29 --- /dev/null +++ b/modules/top-level/files/submodule.nix @@ -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; + }; +}