about summary refs log tree commit diff
path: root/lib/trivial.nix
Commit message (Collapse)AuthorAge
* lib: make deprecation warnings consistentAlois Wohlschlager2024-02-03
| | | | | | | The deprecation warnings in lib were wildly inconsistent. Different formulations were used in different places for the same meaning. Some warnings used builtins.trace instead of lib.warn, which prevents silencing; one even only had a comment instead. Make everything more uniform.
* lib/trivial: bump oldestSupportedRelease to 23.11figsoda2024-01-29
|
* Merge pull request #273470 from adisbladis/lib-tohexstring-static-valuesSilvan Mosberger2023-12-11
|\ | | | | lib.toHexString: Statically compute hexDigits attrset
| * lib.toHexString: Statically compute hexDigits attrsetadisbladis2023-12-11
| |
* | Merge pull request #273467 from adisbladis/lib-pipe-no-letSilvan Mosberger2023-12-11
|\ \ | | | | | | lib.pipe: Avoid creating a scope
| * | lib.pipe: Avoid creating scopesadisbladis2023-12-11
| |/
* / lib/trivial: drop `rec` in favor of `lib` fixpointMaximilian Bosch2023-12-10
|/ | | | | | | | | That way each expression uses the final version of other lib.trivial declarations. For instance, when replacing `versionSuffix` with the string `"fnord"` in a lib overlay, `trivial.version` uses `"fnord"` as suffix now rather than `pre-git`.
* 24.05 is Uakarifigsoda2023-11-21
|
* lib.mirrorFunctionArgs: initYueh-Shun Li2023-11-07
| | | | Co-authored-by: Silvan Mosberger <github@infinisil.com>
* Merge pull request #235625 from ShamrockLee/lib-doc-tidySilvan Mosberger2023-08-10
|\
| * lib: fix nix-doc variable "Type" in commentYueh-Shun Li2023-06-03
| | | | | | | | Fix documentation of lib.trivial.importJSON and lib.trivial.importTOML
* | lib/trivial: Bump oldestSupportedReleaseto to 23.05Martin Weinelt2023-07-04
|/
* 23.11 is TapirRaito Bezarius2023-05-22
|
* lib/trival: Bump oldestSupportedRelease to 2211Martin Weinelt2023-01-01
|
* Merge pull request #202370 from Artturin/revertpartof1Artturi2022-11-22
|\ | | | | Revert "lib/trivial: fix 'error: cannot decode virtual path '/nix/sto…
| * Revert "lib/trivial: fix 'error: cannot decode virtual path ↵Artturin2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '/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
* | 23.05 is StoatMartin Weinelt2022-11-21
|/
* Merge pull request #199812 from Artturin/removeusagesoftostringonpath1Artturi2022-11-17
|\ | | | | lib/sources: remove 2 usages of toString on a path which will be read using fileContents
| * lib/trivial: fix 'error: cannot decode virtual path ↵Artturin2022-11-06
| | | | | | | | | | | | '/nix/store/virtual0000000000000000000000005-source'' happens on lazy-trees branch of Nix (NixOS/nix#6530)
* | lib.trivial.toBaseDigits: type checkWeijia Wang2022-11-11
| |
* | Revert "lib,doc: remove obvious usages of toString on paths"Anderson Torres2022-11-05
| |
* | lib,doc: remove obvious usages of toString on pathsArtturin2022-11-06
|/ | | | | | | | | | | | | | | | | | | | | | | | It gives a warning on the lazy-trees branch of Nix (NixOS/nix#6530) one of these was also giving me an error (the one in lib/trivial probably) ``` $ nix build warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/installer/sd-card/sd -image-aarch64.nix' and then accessing it is deprecated, at /home/artturin/nixgits/my-nixpkgs/lib/modules. nix:349:99 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/.git' and then accessing it is dep recated, at /home/artturin/nixgits/my-nixpkgs/lib/sources.nix:35:32 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/system/etc/etc.nix' and then accessing it is deprecated, at «stdin»:0 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/system/etc/etc-activ ation.nix' and then accessing it is deprecated, at «stdin»:0 warning: applying 'toString' to path '/home/artturin/nixgits/my-nixpkgs/nixos/modules/installer/sd-card/sd -image-aarch64.nix' and then accessing it is deprecated, at «stdin»:0 error: cannot decode virtual path '/nix/store/virtual0000000000000000000000005-source' (use '--show-trace' to show detailed location information) ```
* lib/trivial: Update oldestSupportedReleaseJanne Heß2022-07-04
|
* Merge pull request #157480 from MatthewCroughan/in-pure-eval-modeRobert Hensing2022-06-10
|\ | | | | lib: add inPureEvalMode
| * lib: add inPureEvalModematthewcroughan2022-05-06
| | | | | | | | | | This makes a value that is true if builtins does not contain the currentSystem function, but false if it does.
* | 22.11 is RaccoonJanne Heß2022-05-23
|/
* Merge pull request #164660 from ncfavier/tests-restrict-argumentsRobert Hensing2022-03-24
|\ | | | | nixos/testing: restrict arguments to makeTest
| * Merge remote-tracking branch 'upstream/master' into tests-restrict-argumentsRobert Hensing2022-03-21
| |\
| * | lib: Add toFunctionRobert Hensing2022-03-21
| | |
* | | Merge pull request #164890 from ncfavier/lib-warn-throwSilvan Mosberger2022-03-22
|\ \ \ | |_|/ |/| | lib/trivial: add warnIfNot and throwIf
| * | lib/trivial: add warnIfNot and throwIfNaïm Favier2022-03-19
| |/ | | | | | | Negated versions of warnIf and throwIfNot.
* / lib: Add mkRenamedOptionModuleWithRobert Hensing2022-03-09
|/ | | | Adds support for sinceRelease
* lib.trivial: Change comment type before concat functionJan Tojnar2022-01-30
| | | | C-style comment was being picked up by nixdoc as a documentation comment for the function.
* lib.checkListOfEnum: initJosé Romildo2022-01-09
|
* lib.throwIfNot: initRobert Hensing2021-12-22
|
* add release notes for 22.05 and update codenameTimothy DeHerrera2021-11-22
|
* lib.warn: Add NIX_ABORT_ON_WARN for call tracesRobert Hensing2021-10-13
|
* lib: fix functionArgs for functorsDavid Arnold2021-08-03
| | | | | | `functionArgs` should give valid results on functions that have been identified with `lib.isFunction` instead of erroring out.
* Merge pull request #110742 from siraben/deprecate-foldBen Siraphob2021-07-27
|\
| * treewide: fold -> foldrBen Siraphob2021-01-26
| |
* | 21.11 is Porcupine!Jonathan Ringer2021-05-22
| |
* | lib.trivial.warnIf: initAlyssa Ross2021-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a common pattern in Nixpkgs to want to emit a warning in certain cases, but not actually change behaviours. This is often expressed as either if cond then lib.warn "Don't do that thing" x else x Or (if cond then lib.warn "Don't do that thing" else lib.id) x Neither of which really expresses the intent here, because it looks like 'x' is being chosen conditionally. To make this clearer, I introduce a "warnIf" function, which makes it clear that the only thing being affected by the condition is whether the warning is generated, not the value being returned.
* | lib.trivial: fix typo "nixpks" -> "nixpkgs"Alyssa Ross2021-04-05
|/
* lib: add importTOMLzimbatm2020-09-12
| | | | | Complements the `lib.importJSON`. `builtins.readTOML` has been introduced in Nix 2.1.
* 21.03 is OkapiJonathan Ringer2020-09-07
| | | | | * Okapi is an artiodactyl mammal native to Central Africa * https://en.wikipedia.org/wiki/Okapi
* lib: toHex -> toHexString & toBase -> toBaseDigitsBas van Dijk2020-07-20
| | | | This makes the type of these functions more apparent from the name.
* lib: add the toHex and toBase utility functionsBas van Dijk2020-07-20
| | | | | | | | | | | | | | | | | | | | | | | | `toHex` converts the given positive integer to a string of the hexadecimal representation of that integer. For example: ``` toHex 0 => "0" toHex 16 => "10" toHex 250 => "FA" ``` `toBase base i` converts the positive integer `i` to a list of it digits in the given `base`. For example: ``` toBase 10 123 => [ 1 2 3 ] toBase 2 6 => [ 1 1 0 ] toBase 16 250 => [ 15 10 ] ```
* 20.09 is Nightingaleworldofpeace2020-02-10
|
* nixos/version: fix case where .git is a symlinkFranz Pletz2020-01-20
| | | | | | | | | | | Before c9214c394b248e1f26e45dbe1be2bd82363af3a6 and 9d396d2e426b9a765de0b8999aa214f1259633e6 if .git is symlink the version would gracefully default to no git revision. With those changes an exception is thrown instead. This introduces a new function `pathIsGitRepo` that checks if `commitIdFromGitRepo` fails without error so we don't have to reimplement this logic again and can fail gracefully.
* lib.commitIdFromGitRepo: support git-worktreeelseym2020-01-10
| | | | | | | | | | | | | | 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