Skip to content
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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5ad16cb27fd8
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 348eaa280bdc
Choose a head ref

Commits on Dec 23, 2019

  1. Copy the full SHA
    47ddb60 View commit details

Commits on Dec 30, 2019

  1. flacon: improvements

    1. Use libsForQt5.callPackage instead of raw callPackage` (this adds
    ability to import qtbase and qttools directly instead of importing whole
    qt5)
    2. Include wrapQtAppsHook in nativeBuildInputs
    
    The major point of this changes is to provide support for running
    support flacon under wayland session, but it may help in some other use
    cases
    
    Closes #76588
    snglth committed Dec 30, 2019
    Copy the full SHA
    345b192 View commit details
  2. Copy the full SHA
    07d0acf View commit details

Commits on Jan 7, 2020

  1. nixosTests.initdb: port to python

    Jacek Galowicz committed Jan 7, 2020
    Copy the full SHA
    c44331d View commit details
  2. Improve documentation for stateVersion

    The meaning of stateVersion often leads to a lot of confusion. This
    commit trys to improve that situation.
    maralorn committed Jan 7, 2020
    Copy the full SHA
    c1d7850 View commit details

Commits on Jan 8, 2020

  1. reviewdog: 0.9.14 -> 0.9.15

    marsam committed Jan 8, 2020
    Copy the full SHA
    3228b9d View commit details
  2. nixosTests.elk: port to python

    Jacek Galowicz committed Jan 8, 2020
    Copy the full SHA
    8ecd07f View commit details
  3. nixosTests.kafka: port to python

    Jacek Galowicz committed Jan 8, 2020
    Copy the full SHA
    f7b274d View commit details
  4. kicad: split version.nix & add update.sh

    update.sh generates version.nix
      by default only updates kicad-unstable
      several options (can be combined)
        all, update to latest tag and master
        clean, generate versions.sh from scratch
        commit, make a git commit
    evils committed Jan 8, 2020
    Copy the full SHA
    2607c4b View commit details

Commits on Jan 9, 2020

  1. nixos/powertop: wait for hardware to initialize

    We should wait until after `multi-user.target` is triggered to allow
    hardware to finish initializing, such as network devices and USB drives.
    This ensures `powertop --auto-tune` sets more tunables to "Good".
    
    Fixes #66820
    meatcar committed Jan 9, 2020
    Copy the full SHA
    90b6823 View commit details
  2. buildRubyGem: strip by default

    I'm not sure why this was disabled, but it looks like a pretty
    harmless way to bring down closure size and remove references to
    compilers and stuff.
    alyssais committed Jan 9, 2020
    Copy the full SHA
    11970ee View commit details
  3. Copy the full SHA
    ec8293f View commit details
  4. ruby: remove references to CC by default

    This makes RbConfig["CC"] return an invalid path, but I hope nothing
    is depending on that anyway...
    alyssais committed Jan 9, 2020
    Copy the full SHA
    1636189 View commit details
  5. defaultGemConfig: reduce mathematical closure size

    ext/ isn't needed once the extensions have been built, contains
    references to a bunch of huge dependencies, and contains megabytes of
    tests.
    alyssais committed Jan 9, 2020
    Copy the full SHA
    fbe4716 View commit details
  6. defaultGemConfig: remove asciidoctor-diagram JARs

    (Except on JRuby, where these are presumably important.)
    alyssais committed Jan 9, 2020
    Copy the full SHA
    1ac11cc View commit details
  7. nixosTests.postgres: Refactor code

    Jacek Galowicz committed Jan 9, 2020
    Copy the full SHA
    fff1c28 View commit details
  8. nixosTests.initdb: Move code to existing postgres test

    Jacek Galowicz committed Jan 9, 2020
    Copy the full SHA
    abebf8c View commit details

Commits on Jan 10, 2020

  1. Copy the full SHA
    85b74dd View commit details
  2. xterm: 349 -> 351

    NeQuissimus committed Jan 10, 2020
    Copy the full SHA
    0916988 View commit details
  3. mxisd: use latest gradle

    Milan Pässler committed Jan 10, 2020
    Copy the full SHA
    8ed9207 View commit details
  4. gradle: remove old versions

    Milan Pässler committed Jan 10, 2020
    Copy the full SHA
    8337bb6 View commit details
  5. jd-gui: use gradle from nixpkgs

    It builds just fine with the packaged gradle, no reason to pull in
    another impure dependency.
    Milan Pässler committed Jan 10, 2020
    Copy the full SHA
    2e6053d View commit details
  6. jd-gui: 1.6.5 -> 1.6.6

    Milan Pässler committed Jan 10, 2020
    Copy the full SHA
    eac1713 View commit details
  7. qutebrowser: 1.8.3 -> 1.9.0

    Closes #77360
    emmanuelrosa committed Jan 10, 2020
    Copy the full SHA
    216dea5 View commit details
  8. google-cloud-sdk: include openssl(1) in PATH (#77277)

    Otherwise, it might fail with a mysterious error:
    
        ERROR: (gcloud.beta.compute.reset-windows-password) Your platform does not support OpenSSL.
    edef1c authored and zimbatm committed Jan 10, 2020
    Copy the full SHA
    178ac3c View commit details
  9. lorri: unstable-2019-10-30 -> unstable-2020-01-09

    `rustfmt` is now a compile time dependency because the varlink generated
    code is formatted with it.
    curiousleo committed Jan 10, 2020
    Copy the full SHA
    c976dc1 View commit details
  10. Merge pull request #77417 from petabyteboy/feature/gradle-cleanup

    remove old gradle versions
    flokli authored Jan 10, 2020
    Copy the full SHA
    f29e259 View commit details
  11. lazygit: 0.12.3 -> 0.13

    Br1ght0ne committed Jan 10, 2020
    Copy the full SHA
    0a7ef3c View commit details
  12. Merge pull request #77425 from emmanuelrosa/qutebrowser-1.9

    qutebrowser: 1.8.3 -> 1.9.0
    flokli authored Jan 10, 2020
    Copy the full SHA
    0c26ef9 View commit details
  13. Merge pull request #77380 from curiousleo/lorri-unstable-2020-01-09

    lorri: unstable-2019-10-30 -> unstable-2020-01-09
    flokli authored Jan 10, 2020
    Copy the full SHA
    fe414f3 View commit details
  14. morph: 1.3.1 -> 1.4.0

    flokli committed Jan 10, 2020
    Copy the full SHA
    e735ef2 View commit details
  15. gede: 2.14.1 -> 2.15.1

    juliendehos committed Jan 10, 2020
    Copy the full SHA
    5aac988 View commit details
  16. Copy the full SHA
    7994673 View commit details
  17. Copy the full SHA
    384d963 View commit details
  18. Merge pull request #77305 from juliendehos/gede

    gede: 2.14.1 -> 2.15.1
    markuskowa authored Jan 10, 2020
    Copy the full SHA
    9473c08 View commit details
  19. trojita: add explicit libsecret dependency

    This was previously a transitive dependency.
    
    Fix #77296
    ehmry committed Jan 10, 2020
    Copy the full SHA
    dcf9c11 View commit details
  20. Merge pull request #77414 from NeQuissimus/xterm_351

    xterm: 349 -> 351
    markuskowa authored Jan 10, 2020
    Copy the full SHA
    7a4d2de View commit details
  21. Merge pull request #77412 from marsam/update-postgresqlPackages.plv8

    postgresqlPackages.plv8: 2.3.13 -> 2.3.14
    lsix authored Jan 10, 2020
    Copy the full SHA
    2f3562f View commit details
  22. Merge pull request #77427 from filalex77/lazygit-0.13

    lazygit: 0.12.3 -> 0.13
    fpletz authored Jan 10, 2020
    Copy the full SHA
    7fb6e4a View commit details
  23. poetry2nix: 1.1.0 -> 1.2.0

    adisbladis committed Jan 10, 2020
    Copy the full SHA
    9dbedf0 View commit details
  24. poetry: 1.0.0 -> 1.0.1

    adisbladis committed Jan 10, 2020
    Copy the full SHA
    e493969 View commit details
  25. Merge pull request #77279 from maralorn/stateVersion-docs

    Improve documentation for stateVersion
    nh2 authored Jan 10, 2020
    Copy the full SHA
    902d102 View commit details
  26. Copy the full SHA
    47ddee7 View commit details
  27. haskellPackages.ormolu: mark unbroken

    Builds fine with 6b5bb4261c6dacbe65d348376c416c75ddafaebd
    aforemny committed Jan 10, 2020
    Copy the full SHA
    9e80857 View commit details
  28. Merge pull request #76236 from r-ryantm/auto-update/calamares

    calamares: 3.2.16 -> 3.2.17.1
    ryantm authored Jan 10, 2020
    Copy the full SHA
    25e45c7 View commit details
  29. Merge pull request #77431 from flokli/morph-1.4.0

    morph: 1.3.1 -> 1.4.0
    andir authored Jan 10, 2020
    Copy the full SHA
    f21a5ad View commit details
  30. Merge pull request #77439 from aforemny/ormolu

    Fix haskellPackages.ormolu
    peti authored Jan 10, 2020
    Copy the full SHA
    6a36e65 View commit details
  31. kicad: split version.nix & add update.sh (#77003)

    kicad: split version.nix & add update.sh
    Mic92 authored Jan 10, 2020
    Copy the full SHA
    01d93cb View commit details
  32. Merge pull request #77437 from adisbladis/poetry-1_0_1

    poetry: 1.0.0 -> 1.0.1
    zimbatm authored Jan 10, 2020
    Copy the full SHA
    e639d3e View commit details
  33. Merge pull request #77149 from alyssais/asciidoctor

    Reduce AsciiDoctor closure size
    zimbatm authored Jan 10, 2020
    Copy the full SHA
    ddc83e6 View commit details
Showing with 1,063 additions and 562 deletions.
  1. +19 −14 lib/modules.nix
  2. +9 −0 lib/tests/modules.sh
  3. +7 −0 lib/tests/modules/attrsOf-conditional-check.nix
  4. +7 −0 lib/tests/modules/attrsOf-lazy-check.nix
  5. +6 −0 lib/tests/modules/declare-attrsOf.nix
  6. +6 −0 lib/tests/modules/declare-lazyAttrsOf.nix
  7. +3 −9 lib/tests/modules/import-from-store.nix
  8. +42 −2 lib/types.nix
  9. +6 −0 maintainers/maintainer-list.nix
  10. +30 −0 nixos/doc/manual/development/option-types.xml
  11. +6 −4 nixos/modules/installer/tools/tools.nix
  12. +9 −2 nixos/modules/misc/version.nix
  13. +1 −0 nixos/modules/tasks/powertop.nix
  14. +56 −51 nixos/tests/elk.nix
  15. +0 −26 nixos/tests/initdb.nix
  16. +29 −14 nixos/tests/kafka.nix
  17. +29 −16 nixos/tests/postgresql.nix
  18. +5 −4 pkgs/applications/audio/flacon/default.nix
  19. +3 −3 pkgs/applications/editors/android-studio/default.nix
  20. +2 −2 pkgs/applications/misc/xterm/default.nix
  21. +1 −0 pkgs/applications/networking/browsers/firefox/packages.nix
  22. +2 −2 pkgs/applications/networking/browsers/qutebrowser/default.nix
  23. +5 −14 pkgs/applications/networking/browsers/qutebrowser/fix-restart.patch
  24. +3 −3 pkgs/applications/networking/gns3/default.nix
  25. +7 −0 pkgs/applications/networking/gns3/gui.nix
  26. +9 −0 pkgs/applications/networking/gns3/server.nix
  27. +2 −0 pkgs/applications/networking/mailreaders/trojita/default.nix
  28. +8 −42 pkgs/applications/science/electronics/kicad/default.nix
  29. +191 −0 pkgs/applications/science/electronics/kicad/update.sh
  30. +52 −0 pkgs/applications/science/electronics/kicad/versions.nix
  31. +4 −1 pkgs/development/compilers/go/1.12.nix
  32. +4 −1 pkgs/development/compilers/go/1.13.nix
  33. +15 −0 pkgs/development/compilers/go/skip-test-extra-files-on-aarch32.patch
  34. +4 −0 pkgs/development/haskell-modules/configuration-common.nix
  35. +0 −1 pkgs/development/haskell-modules/configuration-hackage2nix.yaml
  36. +1 −1 pkgs/development/interpreters/ruby/default.nix
  37. +17 −0 pkgs/development/ruby-modules/gem-config/default.nix
  38. +6 −3 pkgs/development/ruby-modules/gem/default.nix
  39. +0 −34 pkgs/development/tools/build-managers/gradle/default.nix
  40. +2 −2 pkgs/development/tools/lazygit/default.nix
  41. +6 −6 pkgs/development/tools/misc/gede/default.nix
  42. +4 −3 pkgs/development/tools/misc/reviewdog/default.nix
  43. +2 −2 pkgs/development/tools/ocaml/dune/2.nix
  44. +2 −6 pkgs/development/tools/poetry/default.nix
  45. +162 −82 pkgs/development/tools/poetry/poetry.lock
  46. +5 −5 pkgs/development/tools/poetry/pyproject.toml
  47. +6 −0 pkgs/development/tools/poetry/src.json
  48. +9 −0 pkgs/development/tools/poetry/update
  49. +3 −2 pkgs/development/tools/poetry2nix/poetry2nix/default.nix
  50. +2 −1 pkgs/development/tools/poetry2nix/poetry2nix/extensions.json
  51. +7 −1 pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
  52. +23 −6 pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix
  53. +2 −53 pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
  54. +12 −4 pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
  55. +15 −8 pkgs/development/tools/poetry2nix/poetry2nix/semver.nix
  56. +129 −72 pkgs/development/tools/rust/cargo-make/Cargo.lock
  57. +3 −3 pkgs/development/tools/rust/cargo-make/default.nix
  58. +11 −0 pkgs/misc/vim-plugins/generated.nix
  59. +1 −0 pkgs/misc/vim-plugins/vim-plugin-names
  60. +5 −3 pkgs/os-specific/linux/nvme-cli/default.nix
  61. +3 −3 pkgs/servers/mxisd/default.nix
  62. +2 −2 pkgs/servers/sql/postgresql/ext/plv8.nix
  63. +3 −2 pkgs/tools/admin/google-cloud-sdk/default.nix
  64. +2 −2 pkgs/tools/misc/calamares/default.nix
  65. +5 −5 pkgs/tools/misc/lorri/default.nix
  66. +20 −15 pkgs/tools/misc/lorri/runtime.nix
  67. +2 −2 pkgs/tools/package-management/morph/default.nix
  68. +8 −15 pkgs/tools/security/jd-gui/default.nix
  69. +1 −8 pkgs/top-level/all-packages.nix
33 changes: 19 additions & 14 deletions lib/modules.nix
Original file line number Diff line number Diff line change
@@ -41,7 +41,13 @@ rec {

options = {
_module.args = mkOption {
type = types.attrsOf types.unspecified;
# Because things like `mkIf` are entirely useless for
# `_module.args` (because there's no way modules can check which
# arguments were passed), we'll use `lazyAttrsOf` which drops
# support for that, in turn it's lazy in its values. This means e.g.
# a `_module.args.pkgs = import (fetchTarball { ... }) {}` won't
# start a download when `pkgs` wasn't evaluated.
type = types.lazyAttrsOf types.unspecified;
internal = true;
description = "Arguments passed to each module.";
};
@@ -365,16 +371,9 @@ rec {
else
mergeDefinitions loc opt.type defs';


# The value with a check that it is defined
valueDefined = if res.isDefined then res.mergedValue else
# (nixos-option detects this specific error message and gives it special
# handling. If changed here, please change it there too.)
throw "The option `${showOption loc}' is used but not defined.";

# Apply the 'apply' function to the merged value. This allows options to
# yield a value computed from the definitions
value = if opt ? apply then opt.apply valueDefined else valueDefined;
value = if opt ? apply then opt.apply res.mergedValue else res.mergedValue;

in opt //
{ value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
@@ -408,11 +407,17 @@ rec {
};
defsFinal = defsFinal'.values;

# Type-check the remaining definitions, and merge them.
mergedValue = foldl' (res: def:
if type.check def.value then res
else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'.")
(type.merge loc defsFinal) defsFinal;
# Type-check the remaining definitions, and merge them. Or throw if no definitions.
mergedValue =
if isDefined then
foldl' (res: def:
if type.check def.value then res
else throw "The option value `${showOption loc}' in `${def.file}' is not of type `${type.description}'."
) (type.merge loc defsFinal) defsFinal
else
# (nixos-option detects this specific error message and gives it special
# handling. If changed here, please change it there too.)
throw "The option `${showOption loc}' is used but not defined.";

isDefined = defsFinal != [];

9 changes: 9 additions & 0 deletions lib/tests/modules.sh
Original file line number Diff line number Diff line change
@@ -186,6 +186,15 @@ checkConfigError 'The option .* defined in .* does not exist' config.enable ./di
# Check that imports can depend on derivations
checkConfigOutput "true" config.enable ./import-from-store.nix

# Check attrsOf and lazyAttrsOf. Only lazyAttrsOf should be lazy, and only
# attrsOf should work with conditional definitions
# In addition, lazyAttrsOf should honor an options emptyValue
checkConfigError "is not lazy" config.isLazy ./declare-attrsOf.nix ./attrsOf-lazy-check.nix
checkConfigOutput "true" config.isLazy ./declare-lazyAttrsOf.nix ./attrsOf-lazy-check.nix
checkConfigOutput "true" config.conditionalWorks ./declare-attrsOf.nix ./attrsOf-conditional-check.nix
checkConfigOutput "false" config.conditionalWorks ./declare-lazyAttrsOf.nix ./attrsOf-conditional-check.nix
checkConfigOutput "empty" config.value.foo ./declare-lazyAttrsOf.nix ./attrsOf-conditional-check.nix

cat <<EOF
====== module tests ======
$pass Pass
7 changes: 7 additions & 0 deletions lib/tests/modules/attrsOf-conditional-check.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ lib, config, ... }: {
options.conditionalWorks = lib.mkOption {
default = ! config.value ? foo;
};

config.value.foo = lib.mkIf false "should not be defined";
}
7 changes: 7 additions & 0 deletions lib/tests/modules/attrsOf-lazy-check.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ lib, config, ... }: {
options.isLazy = lib.mkOption {
default = ! config.value ? foo;
};

config.value.bar = throw "is not lazy";
}
6 changes: 6 additions & 0 deletions lib/tests/modules/declare-attrsOf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ lib, ... }: {
options.value = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = {};
};
}
6 changes: 6 additions & 0 deletions lib/tests/modules/declare-lazyAttrsOf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ lib, ... }: {
options.value = lib.mkOption {
type = lib.types.lazyAttrsOf (lib.types.str // { emptyValue.value = "empty"; });
default = {};
};
}
12 changes: 3 additions & 9 deletions lib/tests/modules/import-from-store.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
{ lib, ... }:
let
drv = derivation {
name = "derivation";
system = builtins.currentSystem;
builder = "/bin/sh";
args = [ "-c" "echo {} > $out" ];
};
in {
{

imports = [
"${drv}"
"${builtins.toFile "drv" "{}"}"
./declare-enable.nix
./define-enable.nix
];

}

44 changes: 42 additions & 2 deletions lib/types.nix
Original file line number Diff line number Diff line change
@@ -65,6 +65,11 @@ rec {
# definition values and locations (e.g. [ { file = "/foo.nix";
# value = 1; } { file = "/bar.nix"; value = 2 } ]).
merge ? mergeDefaultOption
, # Whether this type has a value representing nothingness. If it does,
# this should be a value of the form { value = <the nothing value>; }
# If it doesn't, this should be {}
# This may be used when a value is required for `mkIf false`. This allows the extra laziness in e.g. `lazyAttrsOf`.
emptyValue ? {}
, # Return a flat list of sub-options. Used to generate
# documentation.
getSubOptions ? prefix: {}
@@ -88,7 +93,7 @@ rec {
functor ? defaultFunctor name
}:
{ _type = "option-type";
inherit name check merge getSubOptions getSubModules substSubModules typeMerge functor;
inherit name check merge emptyValue getSubOptions getSubModules substSubModules typeMerge functor;
description = if description == null then name else description;
};

@@ -225,6 +230,7 @@ rec {
description = "attribute set";
check = isAttrs;
merge = loc: foldl' (res: def: mergeAttrs res def.value) {};
emptyValue = { value = {}; };
};

# derivation is a reserved keyword.
@@ -265,6 +271,7 @@ rec {
) def.value
else
throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
emptyValue = { value = {}; };
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
getSubModules = elemType.getSubModules;
substSubModules = m: listOf (elemType.substSubModules m);
@@ -273,7 +280,10 @@ rec {

nonEmptyListOf = elemType:
let list = addCheck (types.listOf elemType) (l: l != []);
in list // { description = "non-empty " + list.description; };
in list // {
description = "non-empty " + list.description;
# Note: emptyValue is left as is, because another module may define an element.
};

attrsOf = elemType: mkOptionType rec {
name = "attrsOf";
@@ -285,12 +295,37 @@ rec {
)
# Push down position info.
(map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs)));
emptyValue = { value = {}; };
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: attrsOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
};

# A version of attrsOf that's lazy in its values at the expense of
# conditional definitions not working properly. E.g. defining a value with
# `foo.attr = mkIf false 10`, then `foo ? attr == true`, whereas with
# attrsOf it would correctly be `false`. Accessing `foo.attr` would throw an
# error that it's not defined. Use only if conditional definitions don't make sense.
lazyAttrsOf = elemType: mkOptionType rec {
name = "lazyAttrsOf";
description = "lazy attribute set of ${elemType.description}s";
check = isAttrs;
merge = loc: defs:
zipAttrsWith (name: defs:
let merged = mergeDefinitions (loc ++ [name]) elemType defs;
# mergedValue will trigger an appropriate error when accessed
in merged.optionalValue.value or elemType.emptyValue.value or merged.mergedValue
)
# Push down position info.
(map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs);
emptyValue = { value = {}; };
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: lazyAttrsOf (elemType.substSubModules m);
functor = (defaultFunctor name) // { wrapped = elemType; };
};

# List or attribute set of ...
loaOf = elemType:
let
@@ -339,6 +374,7 @@ rec {
description = "list or attribute set of ${elemType.description}s";
check = x: isList x || isAttrs x;
merge = loc: defs: attrOnly.merge loc (convertAllLists loc defs);
emptyValue = { value = {}; };
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name?>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: loaOf (elemType.substSubModules m);
@@ -350,6 +386,7 @@ rec {
name = "uniq";
inherit (elemType) description check;
merge = mergeOneOption;
emptyValue = elemType.emptyValue;
getSubOptions = elemType.getSubOptions;
getSubModules = elemType.getSubModules;
substSubModules = m: uniq (elemType.substSubModules m);
@@ -367,6 +404,7 @@ rec {
else if nrNulls != 0 then
throw "The option `${showOption loc}` is defined both null and not null, in ${showFiles (getFiles defs)}."
else elemType.merge loc defs;
emptyValue = { value = null; };
getSubOptions = elemType.getSubOptions;
getSubModules = elemType.getSubModules;
substSubModules = m: nullOr (elemType.substSubModules m);
@@ -407,6 +445,7 @@ rec {
args.name = last loc;
prefix = loc;
}).config;
emptyValue = { value = {}; };
getSubOptions = prefix: (evalModules
{ inherit modules prefix specialArgs;
# This is a work-around due to the fact that some sub-modules,
@@ -515,6 +554,7 @@ rec {
if finalType.check val then val
else coerceFunc val;
in finalType.merge loc (map (def: def // { value = coerceVal def.value; }) defs);
emptyValue = finalType.emptyValue;
getSubOptions = finalType.getSubOptions;
getSubModules = finalType.getSubModules;
substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m);
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -7871,4 +7871,10 @@
githubId = 52650;
name = "Marc Busqué";
};
snglth = {
email = "illia@ishestakov.com";
github = "snglth";
githubId = 8686360;
name = "Illia Shestakov";
};
}
30 changes: 30 additions & 0 deletions nixos/doc/manual/development/option-types.xml
Original file line number Diff line number Diff line change
@@ -352,6 +352,36 @@
An attribute set of where all the values are of
<replaceable>t</replaceable> type. Multiple definitions result in the
joined attribute set.
<note><para>
This type is <emphasis>strict</emphasis> in its values, which in turn
means attributes cannot depend on other attributes. See <varname>
types.lazyAttrsOf</varname> for a lazy version.
</para></note>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.lazyAttrsOf</varname> <replaceable>t</replaceable>
</term>
<listitem>
<para>
An attribute set of where all the values are of
<replaceable>t</replaceable> type. Multiple definitions result in the
joined attribute set. This is the lazy version of <varname>types.attrsOf
</varname>, allowing attributes to depend on each other.
<warning><para>
This version does not fully support conditional definitions! With an
option <varname>foo</varname> of this type and a definition
<literal>foo.attr = lib.mkIf false 10</literal>, evaluating
<literal>foo ? attr</literal> will return <literal>true</literal>
even though it should be false. Accessing the value will then throw
an error. For types <replaceable>t</replaceable> that have an
<literal>emptyValue</literal> defined, that value will be returned
instead of throwing an error. So if the type of <literal>foo.attr</literal>
was <literal>lazyAttrsOf (nullOr int)</literal>, <literal>null</literal>
would be returned instead for the same <literal>mkIf false</literal> definition.
</para></warning>
</para>
</listitem>
</varlistentry>
10 changes: 6 additions & 4 deletions nixos/modules/installer/tools/tools.nix
Original file line number Diff line number Diff line change
@@ -159,10 +159,12 @@ in
# extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
# };
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "${config.system.nixos.release}"; # Did you read the comment?
}
11 changes: 9 additions & 2 deletions nixos/modules/misc/version.nix
Original file line number Diff line number Diff line change
@@ -61,11 +61,18 @@ in
configuration defaults in a way incompatible with stateful
data. For instance, if the default version of PostgreSQL
changes, the new version will probably be unable to read your
existing databases. To prevent such breakage, you can set the
existing databases. To prevent such breakage, you should set the
value of this option to the NixOS release with which you want
to be compatible. The effect is that NixOS will option
to be compatible. The effect is that NixOS will use
defaults corresponding to the specified release (such as using
an older version of PostgreSQL).
It‘s perfectly fine and recommended to leave this value at the
release version of the first install of this system.
Changing this option will not upgrade your system. In fact it
is meant to stay constant exactly when you upgrade your system.
You should only bump this option, if you are sure that you can
or have migrated all state on your system which is affected
by this option.
'';
};

1 change: 1 addition & 0 deletions nixos/modules/tasks/powertop.nix
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ in {
systemd.services = {
powertop = {
wantedBy = [ "multi-user.target" ];
after = [ "multi-user.target" ];
description = "Powertop tunings";
path = [ pkgs.kmod ];
serviceConfig = {
Loading