summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2020-01-14lib/types: prioritise coercedType in coercedToarcnmx
This more intuitively matches `types.either` and allows paths to be coerced to submodules again, which was inhibited by #76861
2020-01-14Merge pull request #77047 from NixOS/staging-nextFrederik Rietdijk
Staging next
2020-01-14Merge pull request #75539 from Gabriel439/gabriel/renderOptionsRobert Hensing
Add `pkgs.lib.encodeGNUCommandLine`
2020-01-14Merge master into staging-nextFrederik Rietdijk
2020-01-13Merge pull request #77575 from worldofpeace/home-manager-warnings-dropworldofpeace
lib/types: dont warn loaOf for home-manager namespace
2020-01-13Merge master into staging-nextFrederik Rietdijk
2020-01-13Merge pull request #77473 from mayflower/worktreesLinus Heckemann
lib.commitIdFromGitRepo: support git-worktree
2020-01-12lib/types: dont warn loaOf for home-manager namespaceworldofpeace
This option namespace is not a part of NixOS so we shouldn't provide this warning for it.
2020-01-12Merge pull request #77501 from jtojnar/more-loaof-fxesJan Tojnar
tree-wide: fix more warning related to loaOf deprecation
2020-01-12Merge pull request #76861 from Infinisil/paths-as-submodulesRobert Hensing
lib/types: Allow paths as submodule values
2020-01-11lib/types: improve loaOf message even moreJan Tojnar
Now we suggest correct names for all options in Nixpkgs and also home-manager at the time of writing.
2020-01-11lib/types: only show ... in loaOf warning when necessaryJan Tojnar
2020-01-11lib/types: improve loaOf warningJan Tojnar
Not all modules use name attribute as the name of the submodule, for example, environment.etc uses target. We will need to maintain a list of exceptions.
2020-01-10lib.commitIdFromGitRepo: support git-worktreeelseym
lib.commitIdFromGitRepo now resolves the refs from the parent repository in case the supplied path is a file containing the path to said repository. this adds support for git-worktree and things alike. see gitrepository-layout(5). this also: - adds a new boolean function lib.pathIsRegularFile to check whether a path is a regular file - patches lib.revisionWithDefault and the revision and versionSuffix attributes in config.system.nixos in order to support git-worktrees
2020-01-10Merge master into staging-nextFrederik Rietdijk
2020-01-10lib/modules: Switch _module.args from attrsOf to lazyAttrsOfSilvan Mosberger
2020-01-10lib/tests: Add tests for attrsOf and lazyAttrsOfSilvan Mosberger
2020-01-10lib/types: Introduce lazyAttrsOfSilvan Mosberger
The standard attrsOf is strict in its *values*, meaning it's impossible to access only one attribute value without evaluating all others as well. lazyAttrsOf is a version that doesn't have that problem, at the expense of conditional definitions not properly working anymore.
2020-01-10lib/types: Add emptyValue attribute to typesSilvan Mosberger
Co-Authored-By: Robert Hensing <roberth@users.noreply.github.com>
2020-01-10lib/modules: Move the isDefined check into mergedValueSilvan Mosberger
Without this change, accessing `mergedValue` from `mergeDefinitions` in case there are no definitions will throw an error like error: evaluation aborted with the following error message: 'This case should never happen.' This change makes it throw the appropriate error error: The option `foo' is used but not defined. This is fully backwards compatible.
2020-01-10lib/tests: Fix module testsSilvan Mosberger
Fix the broken test in https://github.com/NixOS/nixpkgs/pull/77416 Apparently hydra uses `nix-build lib/tests/release.nix` to run all tests, where IFD isn't allowed. Fortunately we can get around this with builtins.toFile, which doesn't require IFD, but still can test the properties we want.
2020-01-10Merge master into staging-nextFrederik Rietdijk
2020-01-10lib/tests: Add test case for imports from derivationsSilvan Mosberger
2020-01-10lib/modules: Fix store importsSilvan Mosberger
This fixes imports from the store not being possible, which was caused by https://github.com/NixOS/nixpkgs/pull/76857 E.g. such a case: imports = [ "${home-manager}/nixos" ];
2020-01-09Merge pull request #76857 from Infinisil/recursive-disableModulesSilvan Mosberger
Apply `disabledModules` recursively
2020-01-09lib/tests: Add tests for recursive disabledModulesSilvan Mosberger
2020-01-09lib/modules: Recursive disabledModulesSilvan Mosberger
With this change, disabledModules applies recursively, meaning if you have a module "foo.nix" with imports = [ ./bar.nix ]; then setting disabledModules = [ "foo.nix" ]; will disable both "foo.nix" and "bar.nix", whereas previously only "foo.nix" would be disabled. This change along with https://github.com/NixOS/nixpkgs/pull/61570 allows modules to be fully disabled even when they have some `mkRenamedOption` imports.
2020-01-08lib/types: Allow paths as submodule valuesSilvan Mosberger
2020-01-08Merge branch 'master' into staging-nextVladimír Čunát
The nss rebuild isn't so small.
2020-01-08Clarify error message of 'assigning to top-level attribute' (#76702)Silvan Mosberger
Clarify error message of 'assigning to top-level attribute'
2020-01-07Merge master into staging-nextFrederik Rietdijk
2020-01-07Merge pull request #77133 from Infinisil/fix-path-checkSilvan Mosberger
lib/types: Fix path type check
2020-01-06lib/types: Fix path type checkSilvan Mosberger
Previously when this function was called without a value coercible to a string it would throw an error instead of returning false. Now it does. As a result this now allows the use of a type like `either path attrs` without it erroring out when a definition is an attribute set. The warning about there not being a isPath primop was removed because this is not the case anymore, there is builtins.isPath. But also there always was `builtins.typeOf x == "path"` that could've been used instead. However the path type now stands for more than just path types, but absolute paths in general.
2020-01-06lib/types: warn loaOf is deprecatedrnhmjoj
2020-01-06lib/tests: remove strictly loaOf tests and rebase on attrsOfrnhmjoj
2020-01-05Export toGNUCommandLine Gabriel Gonzalez
... as suggested by @roberth Co-Authored-By: Robert Hensing <roberth@users.noreply.github.com>
2020-01-05Factor out a `toGNUCommandLine` utilityGabriel Gonzalez
... as suggested by @roberth
2020-01-05lib/modules: clarify error message of 'assigning to top-level attribute'Arnout Engelen
If I understand correctly, the problem isn't so much that you're assigning to that top-level attribute, but that the assignment to the attribute (or any child of the attribute) introduces the 'config' object and prevents 'lifting' all settings to a generated 'config' object.
2020-01-03Merge pull request #74284 from matthewbauer/ios-with-xcode-11Matthew Bauer
Update iOS for XCode 11
2020-01-03Merge remote-tracking branch 'origin/master' into ios-with-xcode-11Matthew Bauer
2020-01-03lib/systems: use newer ios sdkMatthew Bauer
2020-01-03lib/tests: Temporarily disable submodule path testSilvan Mosberger
Until https://github.com/NixOS/nixpkgs/pull/76861 or so is merged
2020-01-03Revert "lib/types: Allow paths as submodule values"Silvan Mosberger
This reverts commit eec83d41e3e7d9ad5bc1086198d972d55bab1203. This broke hydra evaluation because with this commit submodule values are allowed to be paths, however the certmgr module uses `either (submodule ...) path` in its type, meaning it already used paths for something else which would now be interpreted as a submodule.
2020-01-02Module system improvements for NixOS as a submodule (#75031)Silvan Mosberger
Module system improvements for NixOS as a submodule
2020-01-02lib/tests: Add submoduleWith testsSilvan Mosberger
2020-01-02lib/types: Allow paths as submodule valuesSilvan Mosberger
2020-01-01lib/modules: Don't pack submodules speciallySilvan Mosberger
This has the beneficial side effect of allowing paths to be used as modules in types.{submodule,submoduleWith}
2020-01-01lib/types: Add types.submoduleWith for more flexibility than types.submoduleSilvan Mosberger
2019-12-15Use a more realistic example that exercises all encodingsGabriel Gonzalez
... as suggested by @roberth This also caught a bug in rendering lists, which this change also fixes
2019-12-13Make behavior of `encodeGNUCommandLine` customizableGabriel Gonzalez
... based on feedback from @edolstra