mirror of
https://github.com/divnix/digga.git
synced 2024-09-11 06:55:55 +03:00
rename current modules -> exportedModules
and externalModules -> modules
This commit is contained in:
parent
58354603ec
commit
0014c5d509
@ -90,6 +90,14 @@ rec {
|
||||
)
|
||||
;
|
||||
|
||||
importModules =
|
||||
lib.warn ''
|
||||
Deprecated Function: lib.importModules.
|
||||
|
||||
Use lib.importExportableModules instead to set `exportedModules` option
|
||||
''
|
||||
importers'.importExportableModules;
|
||||
|
||||
importers =
|
||||
lib.warn ''
|
||||
Deprecated Attribute Set: lib.importers.
|
||||
|
@ -19,24 +19,7 @@ submodule or path convertible to it
|
||||
|
||||
|
||||
|
||||
## devshell.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## devshell.modules
|
||||
## devshell.exportedModules
|
||||
modules to include in all hosts and export to devshellModules output
|
||||
|
||||
|
||||
@ -52,3 +35,38 @@ list of valid module or path convertible to its or anything convertible to it
|
||||
|
||||
|
||||
|
||||
## devshell.externalModules
|
||||
ERROR: The `externalModules` option has been removed.
|
||||
Any modules that should be exported should be defined with the `exportedModules`
|
||||
option and all other modules should just go into the `modules` option.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## devshell.modules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid modules or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -18,9 +18,26 @@ submodule or path convertible to it
|
||||
|
||||
|
||||
|
||||
## home.exportedModules
|
||||
modules to include in all hosts and export to homeModules output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid modules or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## home.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
ERROR: The `externalModules` option has been removed.
|
||||
Any modules that should be exported should be defined with the `exportedModules`
|
||||
option and all other modules should just go into the `modules` option.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
@ -68,7 +85,8 @@ null
|
||||
|
||||
|
||||
## home.modules
|
||||
modules to include in all hosts and export to homeModules output
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
|
@ -49,9 +49,26 @@ channel defined in `channels`
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.exportedModules
|
||||
modules to include in all hosts and export to nixosModules output
|
||||
|
||||
|
||||
*_Type_*:
|
||||
list of valid modules or anything convertible to it
|
||||
|
||||
|
||||
*_Default_*
|
||||
```
|
||||
[]
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## nixos.hostDefaults.externalModules
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
ERROR: The `externalModules` option has been removed.
|
||||
Any modules that should be exported should be defined with the `exportedModules`
|
||||
option and all other modules should just go into the `modules` option.
|
||||
|
||||
|
||||
*_Type_*:
|
||||
@ -67,7 +84,8 @@ list of valid modules or anything convertible to it or path convertible to it
|
||||
|
||||
|
||||
## nixos.hostDefaults.modules
|
||||
modules to include in all hosts and export to nixosModules output
|
||||
modules to include that won't be exported
|
||||
meant importing modules from external flakes
|
||||
|
||||
|
||||
*_Type_*:
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 079adc4474231d5582fee5574bc5bcc6f133e5ac
|
||||
Subproject commit f2c363cadbbd50032f0030de3a28ed8ecdd4fa42
|
@ -1,4 +1,4 @@
|
||||
{ self, ... }:
|
||||
{
|
||||
modules = [ ./python.toml ];
|
||||
exportedModules = [ ./python.toml ];
|
||||
}
|
||||
|
@ -3,5 +3,5 @@ let
|
||||
lib = self.inputs.digga.lib;
|
||||
in
|
||||
{
|
||||
imports = [ (lib.importModules ./modules) ];
|
||||
imports = [ (lib.importExportableModules ./modules) ];
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ let
|
||||
lib = inputs.digga.lib;
|
||||
in
|
||||
{
|
||||
imports = [ (lib.importModules ./modules) ];
|
||||
externalModules = [ ];
|
||||
imports = [ (lib.importExportableModules ./modules) ];
|
||||
modules = [ ];
|
||||
importables = rec {
|
||||
profiles = lib.rakeLeaves ./profiles;
|
||||
suites = with profiles; {
|
||||
|
@ -114,7 +114,7 @@
|
||||
inherit (flake-utils-plus.lib) exportModules exportOverlays exportPackages;
|
||||
inherit mkFlake;
|
||||
inherit (tests) mkTest allProfilesTest;
|
||||
inherit (importers) flattenTree rakeLeaves importOverlays importModules importHosts;
|
||||
inherit (importers) flattenTree rakeLeaves importOverlays importExportableModules importHosts;
|
||||
inherit (generators) mkDeployNodes mkHomeConfigurations;
|
||||
|
||||
# DEPRECATED - will be removed soon
|
||||
@ -124,6 +124,7 @@
|
||||
mkProfileAttrs
|
||||
exporters
|
||||
modules
|
||||
importModules
|
||||
importers
|
||||
;
|
||||
|
||||
|
@ -126,10 +126,10 @@ in
|
||||
overlays = lib.mkAfter (builtins.attrValues (flattenTree (rakeLeaves dir)));
|
||||
};
|
||||
|
||||
importModules = dir:
|
||||
importExportableModules = dir:
|
||||
{
|
||||
# Meant to output a module that sets the modules option
|
||||
modules = builtins.attrValues (flattenTree (rakeLeaves dir));
|
||||
exportedModules = builtins.attrValues (flattenTree (rakeLeaves dir));
|
||||
};
|
||||
|
||||
importHosts = dir:
|
||||
|
@ -25,7 +25,7 @@ let
|
||||
defaultHostModules = [
|
||||
(internal-modules.hmNixosDefaults {
|
||||
specialArgs = config.home.importables;
|
||||
modules = config.home.modules ++ config.home.externalModules;
|
||||
modules = config.home.modules ++ config.home.exportedModules;
|
||||
})
|
||||
(internal-modules.globalDefaults {
|
||||
hmUsers = config.home.users;
|
||||
@ -53,7 +53,8 @@ let
|
||||
# but for proper default handling in fup, null args have to be removed
|
||||
stripHost = args: removeAttrs (lib.filterAttrs (_: arg: arg != null) args) [
|
||||
# arguments in our hosts/hostDefaults api that shouldn't be passed to fup
|
||||
"externalModules"
|
||||
"externalModules" # TODO: remove deprecated option
|
||||
"exportedModules"
|
||||
"tests"
|
||||
];
|
||||
|
||||
@ -79,14 +80,14 @@ let
|
||||
hostDefaults = flake-utils-plus.lib.mergeAny (stripHost config.nixos.hostDefaults) {
|
||||
# add `self` & `inputs` as specialargs so their libs can be used in imports
|
||||
specialArgs = config.nixos.importables // { inherit (config) self inputs; };
|
||||
modules = config.nixos.hostDefaults.externalModules ++ defaultHostModules;
|
||||
modules = config.nixos.hostDefaults.exportedModules ++ defaultHostModules;
|
||||
};
|
||||
|
||||
nixosModules = flake-utils-plus.lib.exportModules config.nixos.hostDefaults.modules;
|
||||
nixosModules = flake-utils-plus.lib.exportModules config.nixos.hostDefaults.exportedModules;
|
||||
|
||||
homeModules = flake-utils-plus.lib.exportModules config.home.modules;
|
||||
homeModules = flake-utils-plus.lib.exportModules config.home.exportedModules;
|
||||
|
||||
devshellModules = flake-utils-plus.lib.exportModules config.devshell.modules;
|
||||
devshellModules = flake-utils-plus.lib.exportModules config.devshell.exportedModules;
|
||||
|
||||
overlays = flake-utils-plus.lib.exportOverlays {
|
||||
# since we can't detect overlays owned by self
|
||||
|
@ -187,9 +187,9 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
exportedModulesOpt = name: { modules = mkOption (exportedModulesOpt' name); };
|
||||
exportedModulesOpt = name: { exportedModules = mkOption (exportedModulesOpt' name); };
|
||||
exportedDevshellModulesOpt = {
|
||||
modules = mkOption (
|
||||
exportedModules = mkOption (
|
||||
(exportedModulesOpt' "devshell") // {
|
||||
type = with types; devshellModulesType;
|
||||
}
|
||||
@ -198,8 +198,8 @@ let
|
||||
|
||||
# This is only needed for hostDefaults
|
||||
# modules in each host don't get exported
|
||||
externalModulesOpt = {
|
||||
externalModules = mkOption {
|
||||
regularModulesOpt = {
|
||||
modules = mkOption {
|
||||
type = with types; pathToOr modulesType;
|
||||
default = [ ];
|
||||
description = ''
|
||||
@ -209,6 +209,28 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
externalModulesDeprecationMessage = ''
|
||||
The `externalModules` option has been removed.
|
||||
Any modules that should be exported should be defined with the `exportedModules`
|
||||
option and all other modules should just go into the `modules` option.
|
||||
'';
|
||||
legacyExternalModulesMod = { config, options, ... }: {
|
||||
options = {
|
||||
externalModules = mkOption {
|
||||
type = with types; modulesType;
|
||||
default = [ ];
|
||||
description = externalModulesDeprecationMessage;
|
||||
};
|
||||
};
|
||||
config = mkIf (config.externalModules != [ ]) {
|
||||
modules = throw ''
|
||||
ERROR: ${externalModulesDeprecationMessage}
|
||||
|
||||
Value of externalModules: ${config.externalModules}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
hostDefaultsOpt = name: {
|
||||
hostDefaults = mkOption {
|
||||
type = with types; hostDefaultsType name;
|
||||
@ -351,7 +373,8 @@ let
|
||||
|
||||
hostDefaultsType = name: with types; submoduleWith {
|
||||
modules = [
|
||||
{ options = systemOpt // (channelNameOpt true) // externalModulesOpt // (exportedModulesOpt name); }
|
||||
{ options = systemOpt // (channelNameOpt true) // regularModulesOpt // (exportedModulesOpt name); }
|
||||
legacyExternalModulesMod
|
||||
];
|
||||
};
|
||||
|
||||
@ -366,7 +389,8 @@ let
|
||||
homeType = with types; submoduleWith {
|
||||
specialArgs = { inherit self inputs; };
|
||||
modules = [
|
||||
{ options = externalModulesOpt // (exportedModulesOpt "home") // importablesOpt // usersOpt; }
|
||||
{ options = regularModulesOpt // (exportedModulesOpt "home") // importablesOpt // usersOpt; }
|
||||
legacyExternalModulesMod
|
||||
legacyImportablesMod
|
||||
];
|
||||
};
|
||||
@ -374,7 +398,8 @@ let
|
||||
devshellType = with types; submoduleWith {
|
||||
specialArgs = { inherit self inputs; };
|
||||
modules = [
|
||||
{ options = externalModulesOpt // exportedDevshellModulesOpt; }
|
||||
{ options = regularModulesOpt // exportedDevshellModulesOpt; }
|
||||
legacyExternalModulesMod
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -20,7 +20,7 @@ let
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
inherit username homeDirectory pkgs system;
|
||||
|
||||
extraModules = config.home.modules ++ config.home.externalModules;
|
||||
extraModules = config.home.modules ++ config.home.exportedModules;
|
||||
extraSpecialArgs = config.home.importables;
|
||||
|
||||
configuration = {
|
||||
@ -53,7 +53,7 @@ in
|
||||
eval = import "${devshell}/modules" pkgs;
|
||||
configuration = {
|
||||
name = lib.mkDefault config.nixos.hostDefaults.channelName;
|
||||
imports = config.devshell.modules ++ config.devshell.externalModules;
|
||||
imports = config.devshell.modules ++ config.devshell.exportedModules;
|
||||
};
|
||||
in
|
||||
(eval {
|
||||
|
Loading…
Reference in New Issue
Block a user