1
1
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:
David Arnold 2021-06-13 21:27:48 -05:00 committed by Parthiv Seetharaman
parent d38d316401
commit 9836d2aeeb
7 changed files with 21 additions and 10 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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;

View File

@ -0,0 +1,2 @@
{ ... }: {
}

View File

@ -1 +0,0 @@
[ ]

View File

@ -1 +0,0 @@
[ ]

View File

@ -0,0 +1,2 @@
{ ... }: {
}