about summary refs log tree commit diff
path: root/pkgs/pkgs-lib
AgeCommit message (Collapse)AuthorFilesLines
2024-05-25formats.javaProperties: Don't set `!allowSubstitutes` in `generate` buildernicoo1-1/+2
2024-05-25formats: Set `preferLocalBuild` in `generate` buildersnicoo3-0/+7
Otherwise, remote builds are used for trivial format conversions.
2024-05-20treewide: remove unused occurence of fetchurl argumentSigmanificient1-2/+1
2024-05-16Merge pull request #311299 from thenhnn/filesender-packaging-php-formatPol Dellaiera3-0/+115
pkgs/formats: add generator for PHP config files
2024-05-16pkgs: add PHP to formats.nixnhnn3-0/+115
2024-04-02formats.hocon: fix typo: compatability to compatibilityPhilip Taron1-1/+1
2024-02-12pkgs.formats: toINIWithGlobalSection wrapperbenaryorg2-45/+171
The new format is based on the existing wrapper and generates an INI file with an unnamed global section at the top as is used by *stunnel* for instance. Technically the INI format is a subset of this however testing, type checking, and API guarantees profit from two separate generators. Co-authored-by: tim-tx <tim-tx@users.noreply.github.com> Signed-off-by: benaryorg <binary@benary.org>
2024-02-12pkgs.formats: negative type checking testsbenaryorg1-38/+118
Tests using `shouldFail` (new) enable testing for whether the type system catches any unintended uses (missing parameters or unavailable data types in the format). It should not be necessary to test for all possible outliers for each format, however format-specific tests (for instance those using a rigid submodule structure) can ensure that common mistakes err out instead of being silently discarded, while also allowing test-driven development of sorts. Signed-off-by: benaryorg <binary@benary.org>
2024-02-09formats.hocon: add backwards compatibilityh7x45-21/+170
2024-02-09formats.hocon: add testsh7x44-0/+137
2024-02-09formats.hocon: inith7x47-0/+481
2023-12-09formats.systemd: init INI-style systemd config file formatMinijackson1-0/+14
2023-10-31formats.libconfig: fix unstable store path dependency in testckie2-8/+8
Previously, this test would verify a writeText file with a constant content is at a precise store path, but this is not actually the case and the store path has changed maybe twice since the original "pkgs.formats: Add libconfig format generator" PR was started, the latest time being after it was merged. We now placehold the store path in expected.txt and substitute it just before we run the diff, alleviating the problem.
2023-10-27pkgs-lib.formats: add note about missing `pkgs` quirkckie1-0/+5
2023-10-27formats.libconfig: add testsh7x44-0/+87
Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com> Signed-off-by: h7x4 <h7x4@nani.wtf>
2023-10-27formats.libconfig: inith7x47-0/+469
Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com> Signed-off-by: h7x4 <h7x4@nani.wtf>
2023-08-27pkgs-lib/tests/formats: fix expected outputK9001-1/+0
2023-04-04formats.pythonVars: initMinijackson1-0/+35
2022-07-01Merge pull request #178365 from fgaz/lib.formats.keyValueAaron Andersen2-0/+94
lib.formats.keyValue: init
2022-06-20formats.keyValue: add testsFrancesco Gazzetta1-0/+45
2022-06-19pkgs-lib: fix JSON, YAML and TOML cross-compilationBen Wolsieffer1-13/+13
Splicing of nativeBuildInputs doesn't work unless callPackage is used, so the generators were attempting to use host platform tools at build time.
2022-06-18lib.formats.keyValue: initFrancesco Gazzetta1-0/+49
2022-06-07treewide: remove usage of runCommandNoCC aliasesSandro Jäckel1-1/+1
2022-05-12Merge pull request #104457 from ju1m/public-inboxSilvan Mosberger1-0/+11
Update public-inbox to 1.8.0 and add systemd services
2022-05-12nixos/public-inbox: initJulien Moutinho1-0/+11
2022-04-25Merge pull request #167172 from hercules-ci/javaProperties-type-coercionsRobert Hensing3-7/+49
`formats.javaProperties`: add type coercions
2022-04-18pkgs-lib.formats: fix tomlkit outputzowoq1-0/+1
2022-04-10tests formats: fix due to tomlkit output changelassulus1-3/+0
2022-04-04tests.pkgs-lib: Fix for darwinRobert Hensing1-1/+2
2022-04-04pkgs.formats.javaProperties: Add type coercionsRobert Hensing3-4/+42
A usability improvement.
2022-04-04tests.pkgs-lib.formats: Allow strings with context in test runnerRobert Hensing1-2/+5
2022-04-04tests.pkgs-lib.formats: Detect when impossible input is fedRobert Hensing1-1/+5
2022-04-04pkgs.formats.javaProperties: Add implementation note to typeRobert Hensing1-0/+24
2022-04-01formats.javaProperties: Add commentRobert Hensing2-4/+11
2022-04-01formats.javaProperties: initRobert Hensing6-5/+260
2022-02-28pkgs-lib: Implement settings format for ElixirMinijackson1-0/+207
2021-08-26formats: Fix yaml testSilvan Mosberger1-2/+2
Faulty test result was introduced in https://github.com/NixOS/nixpkgs/pull/133807
2021-08-25lib.formats.yaml: use well known YAML formatlucasew2-21/+34
The way `(lib.formats.yaml {}).generate` generates YAML is compliant because on YAML 1.2 spec JSON is a subset of YAML but it bugs people's minds and can lead to problems with software that is not compatible with YAML 1.2. This commit also changes the test of the generation function. Data validation/typing remains the same. See #133802. Signed-off-by: lucasew <lucas59356@gmail.com>
2021-08-15treewide: runCommandNoCC -> runCommandRobert Hensing2-3/+3
This has been synonymous for ~5y.
2021-06-28pkgs-lib: allow paths in TOML, YAML and JSONBen Wolsieffer2-0/+6
Paths get automatically added to the store. The INI generator currently chokes on paths, so it is not supported for now.
2021-05-04formats.ini: Introduce `listToValue` argument (#121613)Silvan Mosberger2-2/+40
Allows coercing lists to values. E.g. formats.ini { listToValue = lib.concatMapStringsSep ", " (lib.generators.mkValueStringDefault {}); }
2020-10-19pkgs-lib/tests/formats: improve message on failureVladimír Čunát1-4/+4
Foremost, the message was discarding double quotes on one side of the diff, which was super-confusing to me, as I thought that the format convertor broke that when in fact only whitespace was changed. I thought I'd cat the files, but then... switching to `diff -u` seemed self-sufficient. It felt sufficiently non-controversial to push directly, but certainly feel free to improve further.
2020-10-19pkgs-lib/tests/formats: fix whitespace after PR #100372Vladimír Čunát1-2/+0
Naturally, TOML doesn't define the exact shape of everything. nix build -f pkgs/top-level/release.nix pkgs-lib-tests
2020-07-29pkgs-lib: Add tests for formatsSilvan Mosberger2-0/+159
2020-07-29pkgs-lib: Implement settings formats for JSON, INI, YAML and TOMLSilvan Mosberger2-1/+114
2020-07-29pkgs: Add pkgs-lib structureSilvan Mosberger2-0/+12