Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 595d5fdd3d1c
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4e1f8e4e3193
Choose a head ref

Commits on Jun 20, 2020

  1. Copy the full SHA
    8850a2c View commit details

Commits on Sep 11, 2020

  1. Copy the full SHA
    b82f177 View commit details

Commits on Sep 13, 2020

  1. signal-desktop: fix test

    Test was broken because network is not available during sandboxed test
    run and therefore the expected text was never shown.
    
    ZHF: #97479
    KaiHa committed Sep 13, 2020
    Copy the full SHA
    ddd23d6 View commit details

Commits on Sep 15, 2020

  1. Copy the full SHA
    b381016 View commit details
  2. lib/options: Fix mergeEqualOption for singular functions

    Previously it would error out for a single function definition
    infinisil committed Sep 15, 2020
    Copy the full SHA
    6e7bc2c View commit details
  3. lib/types: Introduce types.anything

    This new type has unsurprising merge behavior: Only attribute sets are
    merged together (recursively), and only if they don't conflict.
    
    This is in contrast to the existing types:
    - types.attrs is problematic because later definitions completely
      override attributes of earlier definitions, and it doesn't support
      mkIf and co.
    - types.unspecified is very similar to types.attrs, but it has smart
      merging behavior that often doesn't make sense, and it doesn't support
      all types
    infinisil committed Sep 15, 2020
    Copy the full SHA
    67551f4 View commit details
  4. Copy the full SHA
    6a7d250 View commit details
  5. Copy the full SHA
    3106993 View commit details

Commits on Sep 16, 2020

  1. tensorflow: Fix compilation with numpy 1.19.x

    Numpy introduced a breaking API change in version 1.19.x, see [1].
    
    There is a simple fix [2] available in the master branch.
    
    [1]: tensorflow/tensorflow#40688
    [2]: tensorflow/tensorflow@75ea0b3
    avdv committed Sep 16, 2020
    Copy the full SHA
    8f5bfd6 View commit details
  2. Copy the full SHA
    81c2d88 View commit details

Commits on Sep 17, 2020

  1. Copy the full SHA
    0f62317 View commit details
  2. lib/generators.toPretty: Wrap in a go function

    As a preparation to the following commit
    infinisil committed Sep 17, 2020
    Copy the full SHA
    4811f54 View commit details
  3. Copy the full SHA
    47f2eb8 View commit details
  4. Copy the full SHA
    073e9b2 View commit details
  5. lib/generators.toPretty: Switch away from δ and λ

    - These symbols can be confusing for those not familiar with them
    - There's no harm in making these more obvious
    - Terminals may not print them correctly either
    
    Also changes the function argument printing slightly to be more obvious
    infinisil committed Sep 17, 2020
    Copy the full SHA
    d0be9e9 View commit details
  6. Copy the full SHA
    05e4d37 View commit details
  7. lib/generators.toPretty: functors should print as functions

    Not attribute sets. So move the function case forward
    infinisil committed Sep 17, 2020
    Copy the full SHA
    15c5ba9 View commit details

Commits on Sep 19, 2020

  1. Copy the full SHA
    5f47df9 View commit details
  2. Copy the full SHA
    3ac630b View commit details

Commits on Sep 20, 2020

  1. Copy the full SHA
    e3796bc View commit details
  2. Copy the full SHA
    e5869f9 View commit details
  3. cawbird: 1.1.0 -> 1.2.1

    - regular version bump to 1.2.0, then bugfix release on top
    - changes: see
        - https://github.com/IBBoard/cawbird/releases/tag/v1.2.0
        - https://github.com/IBBoard/cawbird/releases/tag/v1.2.1
    schmittlauch committed Sep 20, 2020
    Copy the full SHA
    0b3ffb5 View commit details
  4. Copy the full SHA
    8bb5c62 View commit details

Commits on Sep 21, 2020

  1. Copy the full SHA
    a4edf4c View commit details
  2. liboping: fix build on Darwin

    r-burns committed Sep 21, 2020
    Copy the full SHA
    bf71f45 View commit details
  3. singularity: 3.6.2 -> 3.6.3

    jbedo committed Sep 21, 2020
    Copy the full SHA
    efa99ab View commit details
  4. terraform-compliance: fix build

    * Disables lock of pythonPackages.ipython to allow
        building with what's in nixpkgs
    drewrisinger committed Sep 21, 2020
    Copy the full SHA
    85ce380 View commit details
  5. maintainer: Add bryanasdev000

    Signed-off-by: Bryan A. S <bryanasdev000@gmail.com>
    bryanasdev000 committed Sep 21, 2020
    Copy the full SHA
    dbdd5d4 View commit details
  6. Merge pull request #98083 from avdv/zhf-fix-tensorflow

    tensorflow: Fix compilation with numpy 1.19.x
    danieldk authored Sep 21, 2020
    Copy the full SHA
    a034f20 View commit details
  7. popeye: init at 0.8.10

    Signed-off-by: Bryan A. S <bryanasdev000@gmail.com>
    bryanasdev000 committed Sep 21, 2020
    Copy the full SHA
    8465b48 View commit details
  8. velero: init at 1.5.1

    Signed-off-by: Bryan A. S <bryanasdev000@gmail.com>
    bryanasdev000 committed Sep 21, 2020
    Copy the full SHA
    142f6d8 View commit details
  9. velero: remove old heptio-ark package

    Signed-off-by: Bryan A. S <bryanasdev000@gmail.com>
    bryanasdev000 committed Sep 21, 2020
    Copy the full SHA
    617d5b7 View commit details
  10. Merge pull request #98368 from bryanasdev000/bryan

    maintainer: Add bryanasdev000
    AndersonTorres authored Sep 21, 2020
    Copy the full SHA
    5388895 View commit details
  11. Merge pull request #98116 from timjrd/sc-controller-0.4.7-rebased

    sc-controller: fix missing icons (librsvg)
    rnhmjoj authored Sep 21, 2020
    Copy the full SHA
    799f149 View commit details
  12. prometheus: Unbreak IPv6 listenAddress

    The format of the listenAddress option was recently changed to separate
    the address and the port parts. There is now a legacy check that
    tells users to update to the new format. This legacy check produces
    a false positive on IPv6 addresses, since they contain colons.
    
    Fix the regex to make it not match colons within IPv6 addresses.
    kirelagin authored and bjornfor committed Sep 21, 2020
    Copy the full SHA
    a4afd52 View commit details
  13. fontmatrix: 0.6.0 → 0.6.0-qt5 (#97800)

    This is an unofficial port of Fontmatrix 0.6.0 to Qt5
    
    Co-authored-by: symphorien <symphorien@users.noreply.github.com>
    vbgl and symphorien authored Sep 21, 2020
    Copy the full SHA
    4e155d6 View commit details
  14. Copy the full SHA
    c06b0ed View commit details
  15. nvtop: Make independent of Nvidia driver version

    For packages relying on Nvidia drivers we don't want to hard-code the
    location of a particular driver version in the RPATH. Otherwise the
    software might fail with errors such as:
    
    > Impossible to initialize nvidia nvml : Driver/library version mismatch
    
    To fix this the usual pattern in nixpkgs is to add `/run/opengl-driver/lib`
    to the RPATH of these binaries.
    This is the global location where Nvidia libraries are available on
    NixOS and so this makes sure that the nvtop binary can be run with all
    versions of the driver.
    
    At build time however these libraries are not available at that
    particular location. For precisely this use case, Nvidia ships stub
    versions of the driver libraries with the cudatoolkit. So we just need
    to point CMake to that directory.
    
    Fixes: #98328
    knedlsepp committed Sep 21, 2020
    Copy the full SHA
    0996ac6 View commit details
  16. Merge pull request #97119 from Infinisil/types.anything

    Introduce `types.anything`
    roberth authored Sep 21, 2020
    Copy the full SHA
    f3893d8 View commit details
  17. maintainers: add charvp

    chvp committed Sep 21, 2020
    Copy the full SHA
    9ff8733 View commit details
  18. bluej: init at 4.2.2

    chvp committed Sep 21, 2020
    Copy the full SHA
    090cc5d View commit details
  19. beets: add extrafiles plugin

    austinbutler authored and doronbehar committed Sep 21, 2020
    Copy the full SHA
    5d36540 View commit details
  20. ocamlPackages.zarith: 1.9 -> 1.10

    Zimmi48 authored and vbgl committed Sep 21, 2020
    Copy the full SHA
    0bbeca2 View commit details
  21. Copy the full SHA
    20bd6dd View commit details
  22. Copy the full SHA
    cc2982b View commit details
  23. lizardfs: fix build

    Build failure was due to upstream issue, now fixed in the v3.13 RC.
    
    lizardfs/lizardfs#655
    lizardfs/lizardfs#677
    r-burns committed Sep 21, 2020
    Copy the full SHA
    f5a61c2 View commit details
  24. Merge pull request #91745 from austinbutler/beets-plugin-extrafiles

    beets: add extrafiles plugin
    doronbehar authored Sep 21, 2020
    Copy the full SHA
    f6ee70d View commit details
  25. slack: 4.8.0 -> 4.9.1

    for darwin 4.9.0 is the latest
    prusnak committed Sep 21, 2020
    Copy the full SHA
    846acc4 View commit details
  26. Merge pull request #98360 from r-burns/liboping

    liboping: fix build on Darwin
    marsam authored Sep 21, 2020
    Copy the full SHA
    5df60ed View commit details
  27. Merge pull request #98367 from marsam/update-shadowsocks-rust

    shadowsocks-rust: 1.8.17 -> 1.8.18
    marsam authored Sep 21, 2020
    Copy the full SHA
    1c31e69 View commit details
Showing with 1,588 additions and 536 deletions.
  1. +39 −20 lib/generators.nix
  2. +4 −0 lib/options.nix
  3. +65 −7 lib/tests/misc.nix
  4. +29 −0 lib/tests/modules.sh
  5. +12 −0 lib/tests/modules/types-anything/attrs-coercible.nix
  6. +26 −0 lib/tests/modules/types-anything/equal-atoms.nix
  7. +17 −0 lib/tests/modules/types-anything/functions.nix
  8. +16 −0 lib/tests/modules/types-anything/lists.nix
  9. +44 −0 lib/tests/modules/types-anything/mk-mods.nix
  10. +22 −0 lib/tests/modules/types-anything/nested-attrs.nix
  11. +36 −0 lib/types.nix
  12. +12 −0 maintainers/maintainer-list.nix
  13. +58 −10 nixos/doc/manual/development/option-types.xml
  14. +3 −1 nixos/modules/services/monitoring/prometheus/default.nix
  15. +1 −0 nixos/tests/kafka.nix
  16. +7 −2 nixos/tests/signal-desktop.nix
  17. +3 −3 pkgs/applications/editors/android-studio/default.nix
  18. +36 −0 pkgs/applications/editors/bluej/default.nix
  19. +15 −9 pkgs/applications/graphics/fontmatrix/default.nix
  20. +3 −2 pkgs/applications/misc/fuzzel/default.nix
  21. +2 −2 pkgs/applications/misc/gallery-dl/default.nix
  22. +2 −2 pkgs/applications/networking/Sylk/default.nix
  23. +4 −2 pkgs/applications/networking/cawbird/default.nix
  24. +0 −25 pkgs/applications/networking/cluster/heptio-ark/default.nix
  25. +34 −0 pkgs/applications/networking/cluster/popeye/default.nix
  26. +5 −0 pkgs/applications/networking/cluster/terraform-compliance/default.nix
  27. +45 −0 pkgs/applications/networking/cluster/velero/default.nix
  28. +2 −1 pkgs/applications/networking/ids/zeek/default.nix
  29. +7 −0 pkgs/applications/networking/ids/zeek/script.nix
  30. +4 −4 pkgs/applications/networking/instant-messengers/slack/default.nix
  31. +1 −0 pkgs/applications/networking/mailreaders/thunderbird/68.nix
  32. +9 −0 pkgs/applications/networking/mailreaders/thunderbird/default.nix
  33. +2 −2 pkgs/applications/office/softmaker/freeoffice.nix
  34. +1 −1 pkgs/applications/version-management/git-and-tools/default.nix
  35. +13 −14 pkgs/applications/version-management/git-and-tools/git-imerge/default.nix
  36. +2 −2 pkgs/applications/virtualization/singularity/default.nix
  37. +3 −2 pkgs/development/libraries/liboping/default.nix
  38. +5 −1 pkgs/development/libraries/libversion/default.nix
  39. +21 −2 pkgs/development/libraries/sundials/default.nix
  40. +251 −250 pkgs/development/node-packages/node-packages.nix
  41. +2 −2 pkgs/development/ocaml-modules/apron/default.nix
  42. +3 −3 pkgs/development/ocaml-modules/zarith/default.nix
  43. +41 −26 pkgs/development/python-modules/WSME/default.nix
  44. +28 −0 pkgs/development/python-modules/b2sdk/default.nix
  45. +2 −2 pkgs/development/python-modules/bokeh/default.nix
  46. +2 −2 pkgs/development/python-modules/buildbot/default.nix
  47. +1 −1 pkgs/development/python-modules/buildbot/pkg.nix
  48. +5 −5 pkgs/development/python-modules/buildbot/plugins.nix
  49. +1 −1 pkgs/development/python-modules/buildbot/worker.nix
  50. +27 −0 pkgs/development/python-modules/mohawk/default.nix
  51. +33 −12 pkgs/development/python-modules/pecan/default.nix
  52. +38 −0 pkgs/development/python-modules/rising/default.nix
  53. +3 −0 pkgs/development/python-modules/scikits-odes/default.nix
  54. +5 −3 pkgs/development/python-modules/spyder-kernels/default.nix
  55. +9 −4 pkgs/development/python-modules/spyder/default.nix
  56. +7 −0 pkgs/development/python-modules/tensorflow/1/default.nix
  57. +2 −2 pkgs/development/python-modules/xarray/default.nix
  58. +2 −2 pkgs/development/python-modules/xlib/default.nix
  59. +20 −10 pkgs/development/{tools → python-modules}/yq/default.nix
  60. +4 −4 pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
  61. +3 −3 pkgs/development/tools/rust/rust-analyzer/default.nix
  62. +14 −12 pkgs/development/tools/rust/rust-analyzer/generic.nix
  63. +223 −0 pkgs/development/tools/rust/rust-analyzer/no-loop-in-const-fn.patch
  64. +72 −0 pkgs/development/tools/rust/rust-analyzer/no-option-zip.patch
  65. +0 −3 pkgs/misc/drivers/sc-controller/default.nix
  66. +14 −14 pkgs/misc/vscode-extensions/rust-analyzer/build-deps/package.json
  67. +2 −2 pkgs/os-specific/linux/xpadneo/default.nix
  68. +7 −2 pkgs/servers/apache-kafka/default.nix
  69. +16 −10 pkgs/servers/isso/default.nix
  70. +6 −1 pkgs/tools/audio/beets/default.nix
  71. +30 −0 pkgs/tools/audio/beets/extrafiles-plugin.nix
  72. +3 −4 pkgs/tools/backup/duplicity/default.nix
  73. +36 −17 pkgs/tools/filesystems/f3/default.nix
  74. +6 −0 pkgs/tools/filesystems/lizardfs/default.nix
  75. +3 −3 pkgs/tools/networking/shadowsocks-rust/default.nix
  76. +9 −3 pkgs/tools/package-management/nix-prefetch/default.nix
  77. +10 −6 pkgs/tools/system/nvtop/default.nix
  78. +3 −3 pkgs/tools/video/untrunc/default.nix
  79. +12 −10 pkgs/top-level/all-packages.nix
  80. +15 −0 pkgs/top-level/perl-packages.nix
  81. +8 −0 pkgs/top-level/python-packages.nix
59 changes: 39 additions & 20 deletions lib/generators.nix
Original file line number Diff line number Diff line change
@@ -203,40 +203,59 @@ rec {
/* If this option is true, attrsets like { __pretty = fn; val = …; }
will use fn to convert val to a pretty printed representation.
(This means fn is type Val -> String.) */
allowPrettyValues ? false
}@args: v: with builtins;
allowPrettyValues ? false,
/* If this option is true, the output is indented with newlines for attribute sets and lists */
multiline ? true
}@args: let
go = indent: v: with builtins;
let isPath = v: typeOf v == "path";
introSpace = if multiline then "\n${indent} " else " ";
outroSpace = if multiline then "\n${indent}" else " ";
in if isInt v then toString v
else if isFloat v then "~${toString v}"
else if isString v then ''"${libStr.escape [''"''] v}"''
else if isString v then
let
# Separate a string into its lines
newlineSplits = filter (v: ! isList v) (builtins.split "\n" v);
# For a '' string terminated by a \n, which happens when the closing '' is on a new line
multilineResult = "''" + introSpace + concatStringsSep introSpace (lib.init newlineSplits) + outroSpace + "''";
# For a '' string not terminated by a \n, which happens when the closing '' is not on a new line
multilineResult' = "''" + introSpace + concatStringsSep introSpace newlineSplits + "''";
# For single lines, replace all newlines with their escaped representation
singlelineResult = "\"" + libStr.escape [ "\"" ] (concatStringsSep "\\n" newlineSplits) + "\"";
in if multiline && length newlineSplits > 1 then
if lib.last newlineSplits == "" then multilineResult else multilineResult'
else singlelineResult
else if true == v then "true"
else if false == v then "false"
else if null == v then "null"
else if isPath v then toString v
else if isList v then "[ "
+ libStr.concatMapStringsSep " " (toPretty args) v
+ " ]"
else if isList v then
if v == [] then "[ ]"
else "[" + introSpace
+ libStr.concatMapStringsSep introSpace (go (indent + " ")) v
+ outroSpace + "]"
else if isFunction v then
let fna = lib.functionArgs v;
showFnas = concatStringsSep ", " (libAttr.mapAttrsToList
(name: hasDefVal: if hasDefVal then name + "?" else name)
fna);
in if fna == {} then "<function>"
else "<function, args: {${showFnas}}>"
else if isAttrs v then
# apply pretty values if allowed
if attrNames v == [ "__pretty" "val" ] && allowPrettyValues
then v.__pretty v.val
# TODO: there is probably a better representation?
else if v == {} then "{ }"
else if v ? type && v.type == "derivation" then
"<δ:${v.name}>"
# "<δ:${concatStringsSep "," (builtins.attrNames v)}>"
else "{ "
+ libStr.concatStringsSep " " (libAttr.mapAttrsToList
"<derivation ${v.drvPath}>"
else "{" + introSpace
+ libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
(name: value:
"${toPretty args name} = ${toPretty args value};") v)
+ " }"
else if isFunction v then
let fna = lib.functionArgs v;
showFnas = concatStringsSep "," (libAttr.mapAttrsToList
(name: hasDefVal: if hasDefVal then "(${name})" else name)
fna);
in if fna == {} then "<λ>"
else "<λ:{${showFnas}}>"
"${libStr.escapeNixIdentifier name} = ${go (indent + " ") value};") v)
+ outroSpace + "}"
else abort "generators.toPretty: should never happen (v = ${v})";
in go "";

# PLIST handling
toPlist = {}: v: let
4 changes: 4 additions & 0 deletions lib/options.nix
Original file line number Diff line number Diff line change
@@ -107,6 +107,10 @@ rec {
/* "Merge" option definitions by checking that they all have the same value. */
mergeEqualOption = loc: defs:
if defs == [] then abort "This case should never happen."
# Return early if we only have one element
# This also makes it work for functions, because the foldl' below would try
# to compare the first element with itself, which is false for functions
else if length defs == 1 then (elemAt defs 0).value
else foldl' (val: def:
if def.value != val then
throw "The option `${showOption loc}' has conflicting definitions, in ${showFiles (getFiles defs)}."
72 changes: 65 additions & 7 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
@@ -445,32 +445,90 @@ runTests {
expected = builtins.toJSON val;
};

testToPretty = {
expr = mapAttrs (const (generators.toPretty {})) rec {
testToPretty =
let
deriv = derivation { name = "test"; builder = "/bin/sh"; system = builtins.currentSystem; };
in {
expr = mapAttrs (const (generators.toPretty { multiline = false; })) rec {
int = 42;
float = 0.1337;
bool = true;
emptystring = "";
string = ''fno"rd'';
newlinestring = "\n";
path = /. + "/foo";
null_ = null;
function = x: x;
functionArgs = { arg ? 4, foo }: arg;
list = [ 3 4 function [ false ] ];
emptylist = [];
attrs = { foo = null; "foo bar" = "baz"; };
drv = derivation { name = "test"; system = builtins.currentSystem; };
emptyattrs = {};
drv = deriv;
};
expected = rec {
int = "42";
float = "~0.133700";
bool = "true";
emptystring = ''""'';
string = ''"fno\"rd"'';
newlinestring = "\"\\n\"";
path = "/foo";
null_ = "null";
function = "<λ>";
functionArgs = "<λ:{(arg),foo}>";
function = "<function>";
functionArgs = "<function, args: {arg?, foo}>";
list = "[ 3 4 ${function} [ false ] ]";
attrs = "{ \"foo\" = null; \"foo bar\" = \"baz\"; }";
drv = "<δ:test>";
emptylist = "[ ]";
attrs = "{ foo = null; \"foo bar\" = \"baz\"; }";
emptyattrs = "{ }";
drv = "<derivation ${deriv.drvPath}>";
};
};

testToPrettyMultiline = {
expr = mapAttrs (const (generators.toPretty { })) rec {
list = [ 3 4 [ false ] ];
attrs = { foo = null; bar.foo = "baz"; };
newlinestring = "\n";
multilinestring = ''
hello
there
test
'';
multilinestring' = ''
hello
there
test'';
};
expected = rec {
list = ''
[
3
4
[
false
]
]'';
attrs = ''
{
bar = {
foo = "baz";
};
foo = null;
}'';
newlinestring = "''\n \n''";
multilinestring = ''
'''
hello
there
test
''''';
multilinestring' = ''
'''
hello
there
test''''';

};
};

29 changes: 29 additions & 0 deletions lib/tests/modules.sh
Original file line number Diff line number Diff line change
@@ -233,6 +233,35 @@ checkConfigError 'infinite recursion encountered' config.foo ./freeform-attrsOf.
checkConfigError 'The option .* is used but not defined' config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix
checkConfigOutput 24 config.foo ./freeform-lazyAttrsOf.nix ./freeform-unstr-dep-str.nix ./define-value-string.nix

## types.anything
# Check that attribute sets are merged recursively
checkConfigOutput null config.value.foo ./types-anything/nested-attrs.nix
checkConfigOutput null config.value.l1.foo ./types-anything/nested-attrs.nix
checkConfigOutput null config.value.l1.l2.foo ./types-anything/nested-attrs.nix
checkConfigOutput null config.value.l1.l2.l3.foo ./types-anything/nested-attrs.nix
# Attribute sets that are coercible to strings shouldn't be recursed into
checkConfigOutput foo config.value.outPath ./types-anything/attrs-coercible.nix
# Multiple lists aren't concatenated together
checkConfigError 'The option .* has conflicting definitions' config.value ./types-anything/lists.nix
# Check that all equalizable atoms can be used as long as all definitions are equal
checkConfigOutput 0 config.value.int ./types-anything/equal-atoms.nix
checkConfigOutput false config.value.bool ./types-anything/equal-atoms.nix
checkConfigOutput '""' config.value.string ./types-anything/equal-atoms.nix
checkConfigOutput / config.value.path ./types-anything/equal-atoms.nix
checkConfigOutput null config.value.null ./types-anything/equal-atoms.nix
checkConfigOutput 0.1 config.value.float ./types-anything/equal-atoms.nix
# Functions can't be merged together
checkConfigError "The option .* has conflicting definitions" config.value.multiple-lambdas ./types-anything/functions.nix
checkConfigOutput '<LAMBDA>' config.value.single-lambda ./types-anything/functions.nix
# Check that all mk* modifiers are applied
checkConfigError 'attribute .* not found' config.value.mkiffalse ./types-anything/mk-mods.nix
checkConfigOutput '{ }' config.value.mkiftrue ./types-anything/mk-mods.nix
checkConfigOutput 1 config.value.mkdefault ./types-anything/mk-mods.nix
checkConfigOutput '{ }' config.value.mkmerge ./types-anything/mk-mods.nix
checkConfigOutput true config.value.mkbefore ./types-anything/mk-mods.nix
checkConfigOutput 1 config.value.nested.foo ./types-anything/mk-mods.nix
checkConfigOutput baz config.value.nested.bar.baz ./types-anything/mk-mods.nix

cat <<EOF
====== module tests ======
$pass Pass
12 changes: 12 additions & 0 deletions lib/tests/modules/types-anything/attrs-coercible.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config.value = {
outPath = "foo";
err = throw "err";
};

}
26 changes: 26 additions & 0 deletions lib/tests/modules/types-anything/equal-atoms.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config = lib.mkMerge [
{
value.int = 0;
value.bool = false;
value.string = "";
value.path = /.;
value.null = null;
value.float = 0.1;
}
{
value.int = 0;
value.bool = false;
value.string = "";
value.path = /.;
value.null = null;
value.float = 0.1;
}
];

}
17 changes: 17 additions & 0 deletions lib/tests/modules/types-anything/functions.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config = lib.mkMerge [
{
value.single-lambda = x: x;
value.multiple-lambdas = x: x;
}
{
value.multiple-lambdas = x: x;
}
];

}
16 changes: 16 additions & 0 deletions lib/tests/modules/types-anything/lists.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config = lib.mkMerge [
{
value = [ null ];
}
{
value = [ null ];
}
];

}
44 changes: 44 additions & 0 deletions lib/tests/modules/types-anything/mk-mods.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config = lib.mkMerge [
{
value.mkiffalse = lib.mkIf false {};
}
{
value.mkiftrue = lib.mkIf true {};
}
{
value.mkdefault = lib.mkDefault 0;
}
{
value.mkdefault = 1;
}
{
value.mkmerge = lib.mkMerge [
{}
];
}
{
value.mkbefore = lib.mkBefore true;
}
{
value.nested = lib.mkMerge [
{
foo = lib.mkDefault 0;
bar = lib.mkIf false 0;
}
(lib.mkIf true {
foo = lib.mkIf true (lib.mkForce 1);
bar = {
baz = lib.mkDefault "baz";
};
})
];
}
];

}
22 changes: 22 additions & 0 deletions lib/tests/modules/types-anything/nested-attrs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, ... }: {

options.value = lib.mkOption {
type = lib.types.anything;
};

config = lib.mkMerge [
{
value.foo = null;
}
{
value.l1.foo = null;
}
{
value.l1.l2.foo = null;
}
{
value.l1.l2.l3.foo = null;
}
];

}
Loading