summaryrefslogtreecommitdiff
path: root/lib (follow)
Commit message (Expand)AuthorAgeFilesLines
* lib/tests: Add randomized path.subpath.normalise property checksorigin/lib.path.relativeNormaliseSilvan Mosberger2022-12-134-0/+241
* lib/path.nix: Use -> instead of => for lawSilvan Mosberger2022-12-131-1/+1
* lib.path: Don't use `toPretty` for unexpected type errorsSilvan Mosberger2022-12-131-11/+5
* lib/path.*: Fix referencesSilvan Mosberger2022-12-132-6/+6
* lib/path.*: Apply review suggestions•••Co-Authored-By: Robert Hensing <robert@roberthensing.nl> Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Silvan Mosberger2022-12-132-28/+32
* lib.path: More efficient check for `..` componentsSilvan Mosberger2022-12-121-14/+9
* lib/path.*: Address review•••Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Silvan Mosberger2022-12-122-131/+142
* lib.path-design.md: Address feedback•••Now calls string paths subpaths instead of relative paths everywhere, it's also `lib.path.subpath.normalise` now Co-Authored-By: Robert Hensing <robert@roberthensing.nl> Silvan Mosberger2022-12-093-77/+88
* lib.path: relativeNormalise -> relative.normaliseSilvan Mosberger2022-12-092-28/+28
* lib.path.relativeNormalise: init•••Adds a new function to normalise relative paths. This is a prerequisite to later functions like `path.relativeJoin` and `path.append`. Silvan Mosberger2022-12-082-1/+220
* lib.path: init as skeleton•••Currently doesn't contain anything, future commits will add to it Silvan Mosberger2022-12-082-1/+6
* lib: init path-design.md document•••Adds initial work towards a `lib.path` library Originally proposed in https://github.com/NixOS/nixpkgs/pull/200718, but has since gone through some revisions Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io> Silvan Mosberger2022-12-081-0/+177
* lib: Automatically generate lib.filesytem docsSilvan Mosberger2022-10-261-18/+40
* Merge pull request #173949 from jacoblambda/fix-toInt-zero-padding•••lib: add strings.toIntBase10 to parse zero-padded stringsRobert Hensing2022-10-244-8/+160
|\
| * lib/strings: Update docs and restructured code to improve readability of toIn...Jacob Abel2022-10-233-22/+42
| * lib/strings: Improve error message for octal ambiguity in toIntJacob Abel2022-10-231-3/+2
| * lib/strings: Refactor toInt into toInt and toIntBase10Jacob Abel2022-10-234-21/+97
| * lib/strings: Update toInt to handle intermixed ws and zeros. Added testsJacob Abel2022-10-233-8/+25
| * lib/strings: allow toInt to parse zero-padded stringsJacob Abel2022-10-232-4/+44
* | lib.normalizePath: the empty string is not a valid regex on darwin•••presumably due to using libc++'s regex lib instead of libstdc++ on linux Fixes https://github.com/NixOS/nixpkgs/pull/177273#issuecomment-1287562800 Guillaume Girol2022-10-241-1/+1
|/
* Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2022-10-211-0/+10
|\
| * Merge pull request #196397 from fgaz/hikounomizu/initSandro2022-10-211-0/+10
| |\
| | * lib.licenses: add lal12 and lal13Francesco Gazzetta2022-10-171-0/+10
* | | Merge master into staging-nextgithub-actions[bot]2022-10-213-0/+149
|\| |
| * | lib/tests/misc: Add tests for charToInt, escapeC, and normalizePathDaniel Olsen2022-10-201-0/+15
| * | lib.strings: Add normalizePath•••dedupes extranous /'s in filepaths Co-authored-by: Daniel Olsen <daniel.olsen99@gmail.com> ajs1242022-10-201-0/+10
| * | lib.strings: Add function to do C-style escapingDaniel Olsen2022-10-201-0/+13
| * | lib.strings: Add function to convert character to numberDaniel Olsen2022-10-202-0/+111
* | | Merge master into staging-nextgithub-actions[bot]2022-10-201-0/+6
|\| |
| * | Merge pull request #193551 from OPNA2608/init/mac-fdiskSandro2022-10-191-0/+6
| |\ \
| | * | licenses: Add apsl10OPNA26082022-10-131-0/+6
* | | | Merge branch 'master' into staging-next•••; Conflicts: ; pkgs/development/tools/codespell/default.nix codespell 2.2.2 switched to pyproject & setuptools_scm: https://github.com/codespell-project/codespell/pull/2523 Jan Tojnar2022-10-193-7/+13
|\| | |
| * | | Merge pull request #194035 from Ma27/show-option-quoting•••lib/options/showOption: fix quoting of attr-names that are not identifiersRobert Hensing2022-10-183-7/+13
| |\ \ \ | | |_|/ | |/| |
| | * | lib/options/showOption: fix quoting of attr-names that are not identifiers•••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. Maximilian Bosch2022-10-071-3/+9
| | * | lib/types: always use `<function body>` instead of `[function body]` to indic...•••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. Maximilian Bosch2022-10-072-4/+4
* | | | Merge staging-next into staginggithub-actions[bot]2022-10-131-1/+2
|\| | |
| * | | Merge pull request #192755 from hercules-ci/lib-types-unspecified-nameSilvan Mosberger2022-10-131-1/+2
| |\ \ \
| | * | | lib.types.unspecified: Make name match attribute name again•••@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 Robert Hensing2022-09-241-1/+2
* | | | | Merge branch 'master' into stagingVladimír Čunát2022-10-131-5/+0
|\| | | |
| * | | | Merge pull request #193484 from wegank/gpl1-eolSandro2022-10-121-5/+0
| |\ \ \ \
| | * | | | licenses: remove gpl1Weijia Wang2022-09-291-5/+0
* | | | | | treewide: optional -> optionals where the argument is a list•••the argument to optional should not be list Artturin2022-10-101-1/+1
* | | | | | Merge staging-next into staginggithub-actions[bot]2022-10-091-0/+5
|\| | | | |
| * | | | | Merge master into staging-nextgithub-actions[bot]2022-10-091-0/+5
| |\ \ \ \ \
| | * | | | | licenses: add libssh2 licenseWeijia Wang2022-10-091-0/+5
* | | | | | | lib.closePropagation: Remove the quadratic behavior in lib.closePropagation•••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. Guillaume Bouchard2022-10-071-1/+30
|/ / / / / /
* | | | | | Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2022-10-051-0/+5
|\| | | | |
| * | | | | Merge pull request #188265 from steveeJ-forks/pr-holochain-launcher-binSandro2022-10-031-0/+5
| |\ \ \ \ \ | | |_|_|/ / | |/| | | |
| | * | | | lib.licenses: add CAL-1.0Stefan Junker2022-09-151-0/+5
| | |/ / /
* | | | | Merge master into staging-nextgithub-actions[bot]2022-10-026-17/+4
|\| | | |