mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 16:11:51 +03:00
add module importer (raker)
This commit is contained in:
parent
d38d316401
commit
9836d2aeeb
@ -175,6 +175,12 @@ in
|
||||
overlays = lib.mkAfter (builtins.attrValues (flattenTree (rakeLeaves dir)));
|
||||
};
|
||||
|
||||
modules = dir:
|
||||
{
|
||||
# Meant to output a module that sets the modules option
|
||||
modules = builtins.attrValues (flattenTree (rakeLeaves dir));
|
||||
};
|
||||
|
||||
hosts = dir:
|
||||
{
|
||||
# Meant to output a module that sets the hosts option (including constructed host names)
|
||||
|
@ -145,11 +145,14 @@ let
|
||||
includeHostsModule = name: {
|
||||
options = with types; {
|
||||
hostDefaults = mkOption {
|
||||
type = submodule [
|
||||
type = submoduleWith {
|
||||
# allows easy use of the `imports` key
|
||||
modules = [
|
||||
hostModule
|
||||
externalModulesModule
|
||||
(exportModulesModule name)
|
||||
];
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Defaults for all hosts.
|
||||
|
@ -45,10 +45,10 @@ let
|
||||
hostDefaults = {
|
||||
system = "x86_64-linux";
|
||||
channelName = "nixos";
|
||||
modules = ./modules/module-list.nix;
|
||||
imports = [ (lib.importers.modules ./modules) ];
|
||||
externalModules = [
|
||||
{ _module.args.ourlib = self.lib; }
|
||||
./modules/customBuilds.nix
|
||||
./modules/customBuilds.nix # avoid exporting
|
||||
];
|
||||
};
|
||||
|
||||
@ -68,7 +68,7 @@ let
|
||||
};
|
||||
|
||||
home = {
|
||||
modules = ./users/modules/module-list.nix;
|
||||
imports = [ (lib.importers.modules ./user/modules) ];
|
||||
externalModules = [ ];
|
||||
importables = rec {
|
||||
profiles = lib.importers.rakeLeaves ./profiles;
|
||||
|
2
tests/fullFlake/modules/a-module.nix
Normal file
2
tests/fullFlake/modules/a-module.nix
Normal file
@ -0,0 +1,2 @@
|
||||
{ ... }: {
|
||||
}
|
@ -1 +0,0 @@
|
||||
[ ]
|
@ -1 +0,0 @@
|
||||
[ ]
|
2
tests/fullFlake/users/modules/my-module.nix
Normal file
2
tests/fullFlake/users/modules/my-module.nix
Normal file
@ -0,0 +1,2 @@
|
||||
{ ... }: {
|
||||
}
|
Loading…
Reference in New Issue
Block a user