about summary refs log tree commit diff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2022-12-25Merge pull request #206809 from SuperSandro2000/loaOfSandro1-9/+0
2022-12-24attrsets: fix and add some doc typeshsjobeki2-27/+38
2022-12-20Merge pull request #205899 from drupol/font/add-garamond-libreSandro1-0/+5
garamond-libre: init at 1.4
2022-12-20lib/strings: replace poop emoji (#206999)Naïm Favier1-1/+1
2022-12-20garamond-libre: init at 1.4Pol Dellaiera1-0/+5
2022-12-19Merge pull request #205563 from ↵Robert Hensing2-4/+18
hercules-ci/lib-modules-doc-default-and-example-error-context lib.modules: Add error context to rendered default and example attrs
2022-12-19lib/types: remove loaOfSandro Jäckel1-9/+0
2022-12-17lib: fix typosfigsoda8-10/+10
2022-12-15lib.replaceChars: warn about being a deprecated aliasArtturin1-17/+6
replaceStrings has been in nix since 2015(nix 1.10) so it is safe to remove the fallback https://github.com/nixos/nix/commit/d6d5885c1567454754a0d260521bafa0bd5e7fdb
2022-12-11Merge pull request #205457 from ↵Robert Hensing2-6/+11
h7x4/lib-strings-toInt-broken-for-negative-numbers lib.strings: fix negative number handling for `toInt` and `toIntBase10`
2022-12-10lib.generators.toPretty: Add attribute name to error contextRobert Hensing1-1/+4
2022-12-10lib.modules: Add error context to rendered default and example attrsRobert Hensing1-3/+14
2022-12-10lib.strings: fix negative number handling for `toInt` and `toIntBase10`h7x42-6/+11
The previous version would be unstable due to an input validation regex not expecting a '-' in front of the number.
2022-12-09Merge pull request #126213 from ryantm/lib-doc-genValentin Gagarin2-93/+379
doc: auto-generate asserts and attrset library docs
2022-12-08doc: auto-generate asserts and attrset library docsRyan Mulligan2-93/+379
If all the docs are auto-generated, it should be easier to convert them to Commonmark. Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2022-12-08nixos/doc: render option values using `lib.generators.toPretty`Naïm Favier3-9/+28
Render un`_type`d defaults and examples as `literalExpression`s using `lib.generators.toPretty` so that consumers don't have to reinvent Nix pretty-printing. `renderOptionValue` is kept internal for now intentionally. Make `toPretty` print floats as valid Nix values (without a tilde). Get rid of the now-obsolete `substSpecial` function. Move towards disallowing evaluation of packages in the manual by raising a warning on `pkgs.foo.{outPath,drvPath}`; later, this should throw an error. Instead, module authors should use `literalExpression` and `mkPackageOption`.
2022-12-08lib/generators.toPretty: escape strings properlyNaïm Favier2-19/+21
2022-12-08lib/generators.toPretty: don't evaluate derivationsNaïm Favier2-2/+2
With the goal of making `toPretty` suitable for rendering option values, render derivations as `<derivation foo-1.0>` instead of `<derivation /nix/store/…-foo-1.0.drv>`. This is to avoid causing sudden evaluation errors for out-of-tree projects that have options with `default = pkgs.someUnfreePackage;` and no `defaultText`.
2022-12-08Merge pull request #204087 from ncfavier/splitString-simplifyNaïm Favier1-6/+4
2022-12-06lib/default.nix: include mesonOption-related functionsAndersonTorres1-0/+1
To bring them to the scope when calling `lib`.
2022-12-06lib/strings.nix: add mesonOption utility functionAndersonTorres1-0/+55
And some friends, to help write Meson commandline invocations.
2022-12-02Merge pull request #204103 from ncfavier/doc-mkOrderValentin Gagarin1-9/+10
nixos/doc: document `mkOrder` and friends
2022-12-02nixos/doc: document `mkOrder` and friendsNaïm Favier1-9/+10
Add a section on ordering option definitions. Also mention `mkDefault` in the section on `mkOverride`. Clarify the code a bit by renaming `defaultPriority` to `defaultOverridePriority` and introducing `defaultOrderPriority`.
2022-12-02lib/modules: Add context to the "option does not exist" errorRobert Hensing4-1/+21
Add trace items that provide context for a failed definition that can not be caught within the Nix language. This also adds a test for the `tryEval` behavior of `showDefs`.
2022-12-02lib/strings: simplify `splitString`Naïm Favier1-6/+4
There's no need to use `unsafeDiscardStringContext` since https://github.com/NixOS/nix/commit/ee7fe64c0ac00f2be11604a2a6509eb86dc19f0a (Nix 1.8). Also the separator can't have a context since `builtins.split` would fail, so we can assume it doesn't.
2022-11-22Merge pull request #180964 from amjoseph-nixpkgs/pr/mkSkeletonFromList/simplifyJohn Ericson1-23/+23
lib/systems/parse.nix: mkSkeletonFromList: improve readability
2022-11-22Merge pull request #202370 from Artturin/revertpartof1Artturi1-2/+2
Revert "lib/trivial: fix 'error: cannot decode virtual path '/nix/sto…
2022-11-22Revert "lib/trivial: fix 'error: cannot decode virtual path ↵Artturin1-2/+2
'/nix/store/virtual0000000000000000000000005-source''" This reverts commit b67ee6e861903abb04e9024d605dfc7b00922633. https://github.com/NixOS/nixpkgs/issues/202244 error: a string that refers to a store path cannot be appended to a path, at /etc/nixos/nix/nixos-unstable/lib/sources.nix:193:30 appears to happen when there's a nixpkgs git submodule > So one of the things that is different for a git submodule is that the .git folder isn't a folder, it's a textfile that contains (in my case) this: > $ cat nix/nixos-unstable/.git > gitdir: ../../.git/modules/nixpkgs
2022-11-2123.05 is Stoat 23.05-preMartin Weinelt1-1/+1
2022-11-21Merge pull request #170737 from amjoseph-nixpkgs/fix-mips32-detectionArtturi1-1/+1
lib/systems/platforms.nix: fix broken mips32 detection
2022-11-21Merge pull request #201527 from figsoda/libfigsoda3-3/+39
lib/attrsets: add concatMapAttrs
2022-11-20Merge pull request #201946 from Artturin/splicingstuff2Artturi1-6/+9
lib.overrideDerivation: override attrs in __spliced && splice.nix: start deprecating nativeDrv and crossDrv
2022-11-19splice.nix: start deprecating nativeDrv and crossDrvArtturin1-0/+1
2022-11-18lib.overrideDerivation: override attrs in __splicedArtturin1-6/+8
2022-11-18lib/sources: make commitIdFromGitRepoOrError internal and use # for commentsArtturin1-8/+7
so that it doesn't make the manual build fail > Apparently this is related to the combination of this new function not getting exported from the file, while still getting documented.
2022-11-17lib/attrsets: add concatMapAttrsfigsoda3-2/+38
2022-11-17lib/attrsets: simplify chooseDevOutputsfigsoda1-1/+1
2022-11-17Merge pull request #199812 from Artturin/removeusagesoftostringonpath1Artturi2-11/+22
lib/sources: remove 2 usages of toString on a path which will be read using fileContents
2022-11-16licenses: add bsd2WithViewsGabriel Arazas1-0/+5
2022-11-13lib/systems/parse.nix: mkSkeletonFromList: improve readabilityAdam Joseph1-23/+23
The main purpose of this PR is to make the basis for `mkSkeletonFromList`'s decision between `cpu-kernel-libcabi` vs `cpu-vendor-os` clear, without changing its behavior. The existing code obscures this decision behind a sequence of prioritized matches (i.e. `if-then`) which jump around between different coordinates. Two side benefits of this PR: 1. It makes the root cause of #165836 obvious: we are missing a case for `cpu-vendor-libcabi`. This is why nixpkgs stumbles over `*-none-*`. 2. It illuminates some very weird corner cases in the existing logic, like `*-${vendor}-ghcjs` overriding the `vendor` field, and `mingw32` being transformed into `windows` in some cases. Co-authored-by: John Ericson <git@JohnEricson.me>
2022-11-13Merge pull request #82131 from Ericson2314/bsd-crossJohn Ericson6-11/+24
FreeBSD packages: Init at 13.1
2022-11-11Merge pull request #200667 from wegank/to-base-digits-typeSilvan Mosberger1-0/+2
lib.trivial.toBaseDigits: type check
2022-11-11lib.trivial.toBaseDigits: type checkWeijia Wang1-0/+2
2022-11-10Merge master into haskell-updatesgithub-actions[bot]1-15/+0
2022-11-09Merge pull request #196007 from wegank/fdl11-removeSandro1-15/+0
2022-11-09Merge master into haskell-updatesgithub-actions[bot]1-0/+1
2022-11-08lib/types: add `descriptionClass` for `path`Naïm Favier1-0/+1
2022-11-07haskell.compiler.ghc92: 9.2.4 -> 9.2.5sternenseemann1-1/+1
2022-11-07lib/sources: Make pathIsGitRepo not evaluate toString pathRobert Hensing1-7/+18
This requires us to avoid the `tryEval` + `throw` combination, because throw is strict in its error message, and we don't want to drop our single clue when `commitIdFromGitRepo` is used incorrectly.
2022-11-06cross/mingw: fix emulator for mingw32Jörg Thalheim1-3/+2