1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-23 16:11:51 +03:00

ref: don't mix access to configuration inputs and config values

use proper configuration values
This commit is contained in:
David Arnold 2021-07-19 10:41:38 -05:00 committed by Parthiv Seetharaman
parent 2fc56f4dd6
commit 8ed47e8270

View File

@ -5,7 +5,6 @@ let
argOpts = with lib; { config, ... }: argOpts = with lib; { config, ... }:
let let
cfg = config; cfg = config;
inherit (args) self;
# ############# # #############
# Resolver # Resolver
@ -199,8 +198,8 @@ let
inputOpt = name: { inputOpt = name: {
input = mkOption { input = mkOption {
type = flakeType; type = flakeType;
default = self.inputs.${name}; default = cfg.self.inputs.${name};
defaultText = "self.inputs.<name>"; defaultText = "cfg.self.inputs.<name>";
description = '' description = ''
nixpkgs flake input to use for this channel nixpkgs flake input to use for this channel
''; '';
@ -320,7 +319,7 @@ let
}; };
nixosType = with types; submoduleWith { nixosType = with types; submoduleWith {
specialArgs = { inherit self; }; specialArgs.self = cfg.self;
modules = [ modules = [
{ options = (hostsOpt "nixos") // (hostDefaultsOpt "nixos") // importablesOpt; } { options = (hostsOpt "nixos") // (hostDefaultsOpt "nixos") // importablesOpt; }
legacyImportablesMod legacyImportablesMod
@ -328,7 +327,7 @@ let
}; };
homeType = with types; submoduleWith { homeType = with types; submoduleWith {
specialArgs = { inherit self; }; specialArgs.self = cfg.self;
modules = [ modules = [
{ options = externalModulesOpt // (exportedModulesOpt "home") // importablesOpt // usersOpt; } { options = externalModulesOpt // (exportedModulesOpt "home") // importablesOpt // usersOpt; }
legacyImportablesMod legacyImportablesMod
@ -336,7 +335,7 @@ let
}; };
devshellType = with types; submoduleWith { devshellType = with types; submoduleWith {
specialArgs = { inherit self; }; specialArgs.self = cfg.self;
modules = [ modules = [
{ options = externalModulesOpt // exportedDevshellModulesOpt; } { options = externalModulesOpt // exportedDevshellModulesOpt; }
]; ];
@ -359,6 +358,7 @@ let
options = with types; { options = with types; {
self = mkOption { self = mkOption {
type = flakeType; type = flakeType;
readOnly = true;
description = "The flake to create the devos outputs for"; description = "The flake to create the devos outputs for";
}; };
supportedSystems = mkOption { supportedSystems = mkOption {