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

fix: make nixos.hostDefaults.channelName required

In several places `mkFlake` assumes an valid value is set, here.

fixes: #76
This commit is contained in:
David Arnold 2021-07-06 00:17:35 -05:00 committed by Parthiv Seetharaman
parent 0a5325d362
commit a2411ee0ec
2 changed files with 14 additions and 7 deletions

View File

@ -149,7 +149,7 @@ lib.systemFlake (lib.mergeAny
};
};
profilesTests =
profilesTests =
# only for hosts that also are the same system as the current check attribute
if (hostConfigsOnThisSystem != [ ])
then lib.mapAttrs' createProfilesTestOp hostConfigsOnThisSystemWithSuites

View File

@ -110,14 +110,21 @@ let
};
};
channelNameOpt = {
channelNameOpt = required: {
channelName = mkOption {
type = with types; nullOr channelType;
default = null;
description = ''
Channel this host should follow
'';
};
}
//
(
if required then {
type = with types; channelType;
} else {
type = with types; nullOr channelType;
default = null;
}
);
};
modulesOpt = {
@ -286,13 +293,13 @@ let
hostType = with types; attrsOf (submoduleWith {
modules = [
# per-host modules not exported, no external modules
{ options = systemOpt // channelNameOpt // modulesOpt; }
{ options = systemOpt // (channelNameOpt false) // modulesOpt; }
];
});
hostDefaultsType = name: with types; submoduleWith {
modules = [
{ options = systemOpt // channelNameOpt // externalModulesOpt // (exportedModulesOpt name); }
{ options = systemOpt // (channelNameOpt true) // externalModulesOpt // (exportedModulesOpt name); }
];
};