mirror of
https://github.com/divnix/digga.git
synced 2024-12-24 00:21:47 +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)));
|
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:
|
hosts = dir:
|
||||||
{
|
{
|
||||||
# Meant to output a module that sets the hosts option (including constructed host names)
|
# Meant to output a module that sets the hosts option (including constructed host names)
|
||||||
|
@ -145,11 +145,14 @@ let
|
|||||||
includeHostsModule = name: {
|
includeHostsModule = name: {
|
||||||
options = with types; {
|
options = with types; {
|
||||||
hostDefaults = mkOption {
|
hostDefaults = mkOption {
|
||||||
type = submodule [
|
type = submoduleWith {
|
||||||
|
# allows easy use of the `imports` key
|
||||||
|
modules = [
|
||||||
hostModule
|
hostModule
|
||||||
externalModulesModule
|
externalModulesModule
|
||||||
(exportModulesModule name)
|
(exportModulesModule name)
|
||||||
];
|
];
|
||||||
|
};
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Defaults for all hosts.
|
Defaults for all hosts.
|
||||||
|
@ -45,10 +45,10 @@ let
|
|||||||
hostDefaults = {
|
hostDefaults = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
channelName = "nixos";
|
channelName = "nixos";
|
||||||
modules = ./modules/module-list.nix;
|
imports = [ (lib.importers.modules ./modules) ];
|
||||||
externalModules = [
|
externalModules = [
|
||||||
{ _module.args.ourlib = self.lib; }
|
{ _module.args.ourlib = self.lib; }
|
||||||
./modules/customBuilds.nix
|
./modules/customBuilds.nix # avoid exporting
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
modules = ./users/modules/module-list.nix;
|
imports = [ (lib.importers.modules ./user/modules) ];
|
||||||
externalModules = [ ];
|
externalModules = [ ];
|
||||||
importables = rec {
|
importables = rec {
|
||||||
profiles = lib.importers.rakeLeaves ./profiles;
|
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