Merge pull request #164651 from Infinisil/remove-optionSet
lib/modules: Finally remove deprecated types.optionSetmain
commit
99d9d45630
@ -1,53 +0,0 @@ |
||||
# sets of small configurations: |
||||
# Each configuration |
||||
rec { |
||||
# has 2 arguments pkgs and this. |
||||
configA = pkgs: this: { |
||||
# Can depends on other configuration |
||||
require = configB; |
||||
|
||||
# Defines new options |
||||
optionA = pkgs.lib.mkOption { |
||||
# With default values |
||||
default = false; |
||||
# And merging functions. |
||||
merge = pkgs.lib.mergeEnableOption; |
||||
}; |
||||
|
||||
# Add a new definition to other options. |
||||
optionB = this.optionA; |
||||
}; |
||||
|
||||
# Can be used for option header. |
||||
configB = pkgs: this: { |
||||
# Can depends on more than one configuration. |
||||
require = [ configC configD ]; |
||||
|
||||
optionB = pkgs.lib.mkOption { |
||||
default = false; |
||||
}; |
||||
|
||||
# Is not obliged to define other options. |
||||
}; |
||||
|
||||
configC = pkgs: this: { |
||||
require = [ configA ]; |
||||
|
||||
optionC = pkgs.lib.mkOption { |
||||
default = false; |
||||
}; |
||||
|
||||
# Use the default value if it is not overwritten. |
||||
optionA = this.optionC; |
||||
}; |
||||
|
||||
# Can also be used as option configuration only. |
||||
# without any arguments (backward compatibility) |
||||
configD = { |
||||
# Is not forced to specify the require attribute. |
||||
|
||||
# Is not force to make new options. |
||||
optionA = true; |
||||
optionD = false; |
||||
}; |
||||
} |
@ -1,11 +0,0 @@ |
||||
let |
||||
pkgs = import ../../.. {}; |
||||
config = import ./declare.nix; |
||||
in |
||||
with (pkgs.lib); |
||||
|
||||
finalReferenceOptionSets |
||||
filterOptionSets |
||||
pkgs |
||||
# List of main configurations. |
||||
[ config.configB config.configC ] |
@ -1,57 +0,0 @@ |
||||
<?xml version='1.0' encoding='utf-8'?> |
||||
<expr> |
||||
<attrs> |
||||
<attr name="optionA"> |
||||
<list> |
||||
<attrs> |
||||
<attr name="_type"> |
||||
<string value="option" /> |
||||
</attr> |
||||
<attr name="default"> |
||||
<bool value="false" /> |
||||
</attr> |
||||
<attr name="merge"> |
||||
<unevaluated /> |
||||
</attr> |
||||
<attr name="name"> |
||||
<string value="optionA" /> |
||||
</attr> |
||||
</attrs> |
||||
</list> |
||||
</attr> |
||||
<attr name="optionB"> |
||||
<list> |
||||
<attrs> |
||||
<attr name="_type"> |
||||
<string value="option" /> |
||||
</attr> |
||||
<attr name="default"> |
||||
<bool value="false" /> |
||||
</attr> |
||||
<attr name="name"> |
||||
<string value="optionB" /> |
||||
</attr> |
||||
</attrs> |
||||
</list> |
||||
</attr> |
||||
<attr name="optionC"> |
||||
<list> |
||||
<attrs> |
||||
<attr name="_type"> |
||||
<string value="option" /> |
||||
</attr> |
||||
<attr name="default"> |
||||
<bool value="false" /> |
||||
</attr> |
||||
<attr name="name"> |
||||
<string value="optionC" /> |
||||
</attr> |
||||
</attrs> |
||||
</list> |
||||
</attr> |
||||
<attr name="optionD"> |
||||
<attrs> |
||||
</attrs> |
||||
</attr> |
||||
</attrs> |
||||
</expr> |
@ -1,15 +0,0 @@ |
||||
let |
||||
pkgs = import ../../.. {}; |
||||
config = import ./declare.nix; |
||||
|
||||
# Define the handler of unbound options. |
||||
noOption = name: values: |
||||
builtins.trace "Attribute named '${name}' does not match any option declaration." values; |
||||
in |
||||
with (pkgs.lib); |
||||
|
||||
finalReferenceOptionSets |
||||
(mergeOptionSets noOption) |
||||
pkgs |
||||
# List of main configurations. |
||||
[ config.configB config.configC ] |
@ -1,20 +0,0 @@ |
||||
trace: Str("Attribute named 'optionD' does not match any option declaration.",[]) |
||||
<?xml version='1.0' encoding='utf-8'?> |
||||
<expr> |
||||
<attrs> |
||||
<attr name="optionA"> |
||||
<bool value="true" /> |
||||
</attr> |
||||
<attr name="optionB"> |
||||
<bool value="true" /> |
||||
</attr> |
||||
<attr name="optionC"> |
||||
<bool value="false" /> |
||||
</attr> |
||||
<attr name="optionD"> |
||||
<list> |
||||
<bool value="false" /> |
||||
</list> |
||||
</attr> |
||||
</attrs> |
||||
</expr> |
@ -1,9 +0,0 @@ |
||||
#! /bin/sh -e |
||||
|
||||
echo 1>&2 "Test: Merge of option bindings." |
||||
nix-instantiate merge.nix --eval-only --strict --xml >& merge.out |
||||
diff merge.ref merge.out |
||||
|
||||
echo 1>&2 "Test: Filter of option declarations." |
||||
nix-instantiate keep.nix --eval-only --strict --xml >& keep.out |
||||
diff keep.ref keep.out |
Loading…
Reference in new issue