etc module: make .text
and .source
the same priority
Before this change, one could set environment.etc.*.text and .source. .source would always take precedence, regardless of the priorities set. This change means that if, for instance, .text is set with mkForce but .source is set normally, the .text content will be the one to take effect. If they are set with the same priority they will conflict.
This commit is contained in:
parent
add99c5c4e
commit
0e590c91d2
|
@ -85,7 +85,7 @@ in
|
|||
'';
|
||||
|
||||
type = with types; attrsOf (submodule (
|
||||
{ name, config, ... }:
|
||||
{ name, config, options, ... }:
|
||||
{ options = {
|
||||
|
||||
enable = mkOption {
|
||||
|
@ -172,7 +172,9 @@ in
|
|||
target = mkDefault name;
|
||||
source = mkIf (config.text != null) (
|
||||
let name' = "etc-" + baseNameOf name;
|
||||
in mkDefault (pkgs.writeText name' config.text));
|
||||
in mkOverride
|
||||
(options.text.highestPrio or lib.modules.defaultPriority)
|
||||
(pkgs.writeText name' config.text));
|
||||
};
|
||||
|
||||
}));
|
||||
|
|
Loading…
Reference in a new issue