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:
@@ -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));
|
||||
};
|
||||
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user