about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2022-10-19Merge branch 'master' into staging-nextJan Tojnar3-7/+13
; Conflicts: ; pkgs/development/tools/codespell/default.nix codespell 2.2.2 switched to pyproject & setuptools_scm: https://github.com/codespell-project/codespell/pull/2523
2022-10-18Merge pull request #194035 from Ma27/show-option-quotingRobert Hensing3-7/+13
lib/options/showOption: fix quoting of attr-names that are not identifiers
2022-10-17lib.licenses: add lal12 and lal13Francesco Gazzetta1-0/+10
2022-10-13Merge staging-next into staginggithub-actions[bot]1-1/+2
2022-10-13Merge pull request #192755 from hercules-ci/lib-types-unspecified-nameSilvan Mosberger1-1/+2
2022-10-13Merge branch 'master' into stagingVladimír Čunát1-5/+0
2022-10-13licenses: Add apsl10OPNA26081-0/+6
2022-10-12Merge pull request #193484 from wegank/gpl1-eolSandro1-5/+0
2022-10-10treewide: optional -> optionals where the argument is a listArtturin1-1/+1
the argument to optional should not be list
2022-10-09Merge staging-next into staginggithub-actions[bot]1-0/+5
2022-10-09Merge master into staging-nextgithub-actions[bot]1-0/+5
2022-10-09licenses: add libssh2 licenseWeijia Wang1-0/+5
2022-10-07lib.closePropagation: Remove the quadratic behavior in lib.closePropagationGuillaume Bouchard1-1/+30
The code of `lib.closePropagation` was internally using a recursion on the dependencies and returns all the derivation directly or indirectly referenced by buildInputs. `lib.closeProgation` is implemented in pure nix and uses an unique function for list which is quadratic and does "true" equality, which needs deep set comparison. Instead, we use the `builtins.genericClosure` which is implemented as a builtin and uses a more efficient sorting feature. Note that `genericClosure` needs a `key` to discriminate the values, we used the `outPath` which is unique and orderable. On benchmarks, it performs up to 15x time faster on a benchmark related to haskellPackages.ghcWithPackages.
2022-10-07lib/options/showOption: fix quoting of attr-names that are not identifiersMaximilian Bosch1-3/+9
Personally, I think that warnings such as warning: The option `services.redis.enable' defined in `/home/ma27/Projects/nixpkgs/test.nix@node-vm' has been renamed to `services.redis.servers..enable'. are fairly confusing because of the `..` and it's more correct to actually quote that. With this change the warning now looks like this: warning: The option `services.redis.enable' defined in `/home/ma27/Projects/nixpkgs/test.nix@node-vm' has been renamed to `services.redis.servers."".enable'. While implementing that I realized that you'd have a similar problem whenever you use attribute-names that aren't identifiers, e.g. services.nginx.virtualHosts."example.org".locations."/".invalid = 23; now results in the following error: error: The option `interactive.nodes.vm.services.nginx.virtualHosts."example.org".locations."/".invalid' does not exist. Definition values: - In `/home/ma27/Projects/nixpkgs/test.nix@node-vm': 23 Of course there are some corner-cases where this won't work: when generating the manual, you display submodules like this: services.nginx.virtualHosts.<name> Since `<name>` isn't a value, but an indicator for a submodule, it must not be quoted. This also applies to the following identifiers: * `*` for `listOf submodule` * `<function body>` for `functionTo` This might not be correct if you actually have a submodule with an attribute name called `<name>`, but I think it's an improvement over the current situation and for this you'd probably need to make even more complex changes to the module system.
2022-10-07lib/types: always use `<function body>` instead of `[function body]` to ↵Maximilian Bosch2-4/+4
indicate a function inside an option structure The motivation is to have a single identifier for that. Useful for the next commit where I'll try to escape option-parts correctly (options can be any kind of strings, but unless these are Nix identifiers, they must be quoted). Since `<function body>` (or `<name>`/`*`) are special identifiers in error messages and the manual, we need a unique way to mark an option part as function call because these are not to be quoted.
2022-10-05Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt1-0/+5
2022-10-03Merge pull request #188265 from steveeJ-forks/pr-holochain-launcher-binSandro1-0/+5
2022-10-02Merge master into staging-nextgithub-actions[bot]6-17/+4
2022-10-01Merge pull request #193132 from figsoda/clean-upfigsoda6-17/+4
treewide: clean up
2022-09-29Merge master into staging-nextgithub-actions[bot]2-0/+13
2022-09-29licenses: remove gpl1Weijia Wang1-5/+0
2022-09-29lib/systems/default.nix: add efiArch suffixesIvan Nikolaenko1-0/+8
Move already implemented functionality to the upper level so it could be used in a more generic way. Signed-off-by: Ivan Nikolaenko <ivan.nikolaenko@unikie.com>
2022-09-28lib.generators: simplify toYAMLfigsoda1-1/+1
2022-09-28Merge pull request #192650 from drupol/add-sphinx-contrib-mscgenMartin Weinelt1-0/+5
2022-09-28Merge staging-next into staginggithub-actions[bot]6-1/+180
2022-09-28licenses: add BOLA licensePol Dellaiera1-0/+5
2022-09-28Merge pull request #191540 from hercules-ci/nixosTest-modularRobert Hensing6-1/+180
nixosTest: make modular
2022-09-26lib/tests/maintainers.nix: remove unused bindingfigsoda1-1/+0
2022-09-26lib/types.nix: remove unused bindingsfigsoda1-2/+0
2022-09-26lib/sources.nix: remove unused bindingfigsoda1-1/+0
2022-09-26lib/options.nix: remove unused bindingfigsoda1-1/+0
2022-09-26lib/modules.nix: remove unused bindingsfigsoda1-9/+1
2022-09-26lib/generators.nix: remove unused bindingsfigsoda1-2/+2
2022-09-26Merge staging-next into staginggithub-actions[bot]2-2/+17
2022-09-25lib/types.nix: Document that it should not be usedpiegames1-2/+16
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2022-09-25Merge branch 'amjoseph-nixpkgs-pr/resume182058' into stagingtoonn1-0/+14
2022-09-25unionOfDisjoint: use builtins.intersectAttrsAdam Joseph1-5/+8
This brings two benefits: 1. The complete list of collisions is printed in the whenever any colliding attribute is accessed. 2. The sets are intersected using a C++ primitive, which runs in O(n) time (intersecting pre-sorted lists) with small constants rather than interpreted Nix code. Thanks to @toonn for prompting this improvement.
2022-09-24Merge pull request #189836 from erikarvstedt/options-definitionsWithLocationsRobert Hensing1-0/+1
lib/modules: add `definitionsWithLocations` to evaluated options
2022-09-24lib.types.unspecified: Make name match attribute name againRobert Hensing1-1/+2
@Infinisil: This isn't right, the name shouldn't be changed, but instead a description should be added https://github.com/NixOS/nixpkgs/pull/191353#discussion_r978983401
2022-09-21lib/modules: Fix meta duplication in shorthand syntaxRobert Hensing3-1/+24
2022-09-21lib: Add lazyDerivationRobert Hensing3-0/+156
2022-09-17lib.types: Add parentheses where description is ambiguousRobert Hensing2-13/+122
2022-09-15lib.licenses: add CAL-1.0Stefan Junker1-0/+5
2022-09-13Merge pull request #189314 from Artturin/addemulatoravailableArtturi1-30/+39
2022-09-12note that `unionOfDisjoint` is commutative, unlike //Adam Joseph1-1/+2
2022-09-12lib/attrsets.nix: add unionOfDisjointAdam Joseph1-0/+10
2022-09-11lib/systems: add emulatorAvailableArtturin1-30/+39
``` nix-repl> pkgsCross.arm-embedded.stdenv.hostPlatform.emulatorAvailable pkgsCross.arm-embedded.buildPackages false nix-repl> pkgsCross.aarch64-multiplatform.stdenv.hostPlatform.emulatorAvailable pkgsCross.aarch64-multiplatform.buildPackages true ``` will be useful for stuff like handling https://github.com/NixOS/nixpkgs/issues/187109
2022-09-10lib/options: deprecate docbook text and literalDocBookpennae1-1/+4
deprecate literalDocBook by adding a warning (that will not fire yet) to its uses and other docbook literal strings by adding optional warning message to mergeJSON.
2022-09-09Merge pull request #181834 from ncfavier/numbersSilvan Mosberger1-9/+33
lib/types: add `number`
2022-09-06lib/systems: uname.processor is "uname -m", not "uname -p" (#189958)Adam Joseph1-1/+1
The comment in lib/systems/default.nix for uname.processor indicates that it should match `uname -p`. I tried that command and found that it reports `unknown` on all of these machines: - `x86_64-linux` - `aarch64-linux` - `mips64el-linux` - `powerpc64le-linux` The command `uname -m` reports the expected value on all of the above. I think the comment is wrong. So I fixed it.