summary refs log tree commit diff
path: root/lib
Commit message (Collapse)AuthorAge
* Merge pull request #163127 from hercules-ci/optimize-optionSet-compatRobert Hensing2022-03-11
|\ | | | | lib/modules.nix: Optimize optionSet legacy compat code
| * lib/modules.nix: Optimize optionSet legacy compat codeRobert Hensing2022-03-07
| | | | | | | | It's still in the hot path.
* | Merge pull request #163443 from ncfavier/fix-types-packageRobert Hensing2022-03-11
|\ \ | | | | | | lib.types.package: only call toDerivation when necessary
| * | lib.types.package: only call toDerivation when necessaryNaïm Favier2022-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current logic assumes that everything that isn't a derivation is a store path, but it can also be something that's *coercible* to a store path, like a flake input. Unnecessary uses of `lib.toDerivation` result in errors in pure evaluation mode when `builtins.storePath` is disabled. Also document what a `package` is.
* | | lib.types.optionType: Only merge when necessaryRobert Hensing2022-03-10
| | |
* | | lib.isDerivation: SimplifyRobert Hensing2022-03-09
|/ /
* / lib/systems: Fix uclibc float-abi being flippedLevi Wright2022-03-07
|/ | | uclibceabihf and uclibceabi's float hardness was flipped, which causes many headaches
* Merge pull request #162283 from Infinisil/functionTo.descriptionSilvan Mosberger2022-03-02
|\ | | | | lib/types: Fix functionTo description
| * lib/types: Fix functionTo descriptionSilvan Mosberger2022-03-01
| |
* | Merge pull request #149689 from Infinisil/types-typeSilvan Mosberger2022-03-02
|\ \ | |/ |/| Introduce `types.optionType` and use it for `freeformType`
| * lib.modules: Use types.optionType for _module.freeformTypeSilvan Mosberger2022-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | This ensures that the module file locations are propagated to the freeform type, which makes it so that submodules in freeform types now have their declaration location shown in the manual, fixing https://github.com/NixOS/nixpkgs/issues/132085. In addition, this also newly allows freeformTypes to be declared multiple times and all declarations being merged together according to normal option merging. This also removes some awkwardness regarding the type of `freeformType`
| * lib.types: Introduce `types.optionType`Silvan Mosberger2022-03-01
| | | | | | | | | | | | This type correctly merges multiple option types together while also annotating them with file information. In a future commit this will be used for `_module.freeformType`
* | Merge pull request #157301 from pennae/lib-add-mkPackageOption0x4A6F2022-02-28
|\ \ | |/ |/| lib: add mkPackageOption to default.nix
| * lib: add mkPackageOption to default.nixpennae2022-01-29
| | | | | | | | this was forgotten in #155669
* | lib/modules: Use types.raw for _module.argsSilvan Mosberger2022-02-22
| | | | | | | | | | Fixes https://github.com/NixOS/nixpkgs/issues/53458, as types.raw doesn't allow setting multiple values
* | lib/types: Introduce types.raw for unprocessed valuesSilvan Mosberger2022-02-22
| |
* | lib/tests: Add tests for emptyValueSilvan Mosberger2022-02-17
| |
* | lib/types: Fix emptyValue of listOf and nonEmptyListOfSilvan Mosberger2022-02-17
| | | | | | | | | | | | An empty list is [], not {}! Also, non-empty lists shouldn't have a default of an empty list!
* | Merge pull request #155707 from 06kellyjac/fehRenaud2022-02-16
|\ \ | | | | | | feh: correct license
| * | feh: correct license06kellyjac2022-01-28
| | |
* | | Merge remote-tracking branch 'origin/master' into staging-nextJonathan Ringer2022-02-10
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: pkgs/top-level/aliases.nix
| * | | fix: typo in lib/attrsets.nixJohn Rinehart2022-02-10
| | | |
* | | | Merge remote-tracking branch 'origin/master' into staging-nextJonathan Ringer2022-02-06
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: pkgs/development/python-modules/pysdl2/default.nix pkgs/top-level/aliases.nix
| * | | Merge pull request #126769 from ncfavier/nixosSystem-libRobert Hensing2022-02-06
| |\ \ \ | | | | | | | | | | nixos: move default module location logic to `eval-config.nix`
| | * | | lib/modules: introduce setDefaultModuleLocationNaïm Favier2022-01-27
| | | |/ | | |/| | | | | | | | | Wraps a module with a default location for reporting errors.
* | | | Merge remote-tracking branch 'origin/master' into staging-nextJonathan Ringer2022-02-06
|\| | | | | | | | | | | | | | | | | | | Conflicts: pkgs/tools/graphics/scrot/default.nix
| * | | lib.sources: Improve docsJan Tojnar2022-01-30
| | | | | | | | | | | | | | | | | | | | Change comment type so than nixdoc picks them up into Nixpkgs manual. Also improve phrasing a bit and move stuff around so that it is formatted better.
| * | | 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.
* | | Merge branch 'staging-next' into stagingDmitry Kalinkin2022-01-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: nixos/doc/manual/from_md/release-notes/rl-2205.section.xml nixos/doc/manual/release-notes/rl-2205.section.md pkgs/development/python-modules/aioesphomeapi/default.nix pkgs/development/python-modules/mat2/default.nix pkgs/development/python-modules/pydevccu/default.nix pkgs/development/python-modules/pywlroots/default.nix pkgs/development/python-modules/rokuecp/default.nix
| * | Merge pull request #156503 from hercules-ci/nixos-add-system.build-optionsRobert Hensing2022-01-25
| |\ \ | | | | | | | | nixos: Add `system.build.`{`toplevel`,`installBootLoader`}, improve error message
| | * | lib.modules: Define mergeOneOption in terms of mergeUniqueOptionRobert Hensing2022-01-24
| | | |
| | * | lib.types: Add unique like uniq, but custom errorsRobert Hensing2022-01-24
| | | | | | | | | | | | | | | | | | | | Couldn't extend types.uniq and it had a silly name anyway. Now we can have better error messages.
* | | | Merge remote-tracking branch 'origin/staging-next' into stagingJonathan Ringer2022-01-24
|\| | | | | | | | | | | | | | | | | | | Conflicts: pkgs/development/python-modules/googleapis-common-protos/default.nix
| * | | lib/meta: fix typo in platformMatch commentThiago Kenji Okada2022-01-24
| | | |
| * | | Merge pull request #155669 from schuelermine/patch-mkPackageOptionpennae2022-01-24
| |\ \ \ | | | | | | | | | | lib/options: Add mkPackageOption
| | * | | nixos/docs/option-declarations: Document mkEnableOption and mkPackageOptionAnselm Schüler2022-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squashed commit. These are the original commit messages: lib/option: Improve comment better comment Update documentation Updated nixos/doc/manual/development/options-declarations.md with info on mkEnableOption and mkPackageOption. Updated the comment on mkEnableOption in lib/options.nix remove trailing whitespace nixos/doc/option-declarations: Update IDs & formatting nixos/docs/option-declarations: Escape angle brackets Build DB from MD (Amended) Fix typo Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> (Amended) Build DB from MD (again)
| | * | | lib/options: Add mkPackageOptionAnselm Schüler2022-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squashed commit. These are the original commit messages: lib/options: Add mkPackageOption lib/options: Add missing semicolon lib/options.nix: Make mkPackageOption more complicated lib/options: Fix indent. & spacing lib/options.nix: Remove example and align comment lib/options: ravenous overuse of arguments lib/options: Format better lib/options: Add default examplePath decl lib/options: Make better mkPackageOption function lib/options: Remove trailing whitespace lib/options: Improve mkPackageOptions lib/options: Remove pkgs prefixing Co-authored-by: pennae <82953136+pennae@users.noreply.github.com> lib/options: Slim down mkPackageOption further lib/options: mkPackageOption: Add "pkgs." to example lib/options: mkPackageOption: Make name & pkgs single arguments lib/options: mkPackageOption: Swap name & pkgs lib/options: Remove unnecessary import Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
* | | | | Merge remote-tracking branch 'nixpkgs/staging-next' into stagingAlyssa Ross2022-01-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: pkgs/development/python-modules/cupy/default.nix pkgs/development/python-modules/staticjinja/default.nix
| * | | | Merge pull request #156215 from Atemu/update/svt-av1Martin Weinelt2022-01-24
| |\ \ \ \ | | |_|/ / | |/| | |
| | * | | licenses: add Alliance for Open Media Patent License 1.0Atemu2022-01-22
| | |/ /
* | | | lib.licenses: add MIT-advertisingc0bw3b2022-01-23
| | | |
* | | | lib.licenses: add Imlib2c0bw3b2022-01-22
|/ / /
* | | Merge pull request #155522 from Julow/single_line_strRobert Hensing2022-01-21
|\ \ \ | |/ / |/| | types.singleLineStr: strings that don't contain '\n'
| * | types.singleLineStr: Improve descriptionJules Aguillon2022-01-21
| | | | | | | | | | | | Co-authored-by: pennae <82953136+pennae@users.noreply.github.com>
| * | types.singleLineStr: Allow and trim trailing \nJules Aguillon2022-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow a \n character at the end of the string and remove it during the merge function. An option of this type will resolve to the value "foo" whether it is set to "foo" or "foo\n". This is useful when using 'builtins.readFile' or ''-strings, which might add an unintended newline (for example, bash trim the final newline from a subshell).
| * | types.singleLineStr: Disallow \rJules Aguillon2022-01-18
| | |
| * | types.singleLineStr: strings that don't contain '\n'Jules Aguillon2022-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new type, inheriting 'types.str' but checking whether the value doesn't contain any newline characters. The motivation comes from a problem with the 'users.users.${u}.openssh.authorizedKeys' option. It is easy to unintentionally insert a newline character at the end of a string, or even in the middle, for example: restricted_ssh_keys = command: keys: let prefix = '' command="${command}",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding ''; in map (key: "${prefix} ${key}") keys; The 'prefix' string ends with a newline, which ends up in the middle of a key entry after a few manipulations. This is problematic because the key file is built by concatenating all the keys with 'concatStringsSep "\n"', with result in two entries for the faulty key: '' command="...",options... MY_KEY '' This is hard to debug and might be dangerous. This is now caught at build time.
* | | lib/asserts: use throw to display message for assertMsgsternenseemann2022-01-19
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `assert` has the annoying property that it dumps a lot of code at the user without the built in capability to display a nicer message. We have worked around this using `assertMsg` which would *additionally* display a nice message. We can do even better: By using `throw` we can make evaluation fail before assert draws its conclusions and prevent it from displaying the code making up the assert condition, so we get the nicer message of `throw` and the syntactical convenience of `assert`. Before: nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; } trace: Deterministic builds require stripping bytecode. error: assertion (((lib).assertMsg (reproducibleBuild -> stripBytecode)) "Deterministic builds require stripping bytecode.") failed at /home/lukas/src/nix/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/default.nix:45:1 After: nix-repl> python.override { reproducibleBuild = true; stripBytecode = false; } error: Deterministic builds require stripping bytecode.
* | Merge pull request #152392 from polykernel/attrset-optimizations-patch-1pennae2022-01-11
|\ \ | | | | | | lib/attrset: various function optimizations
| * | lib/attrset: miscellaneous optimizationspolykernel2021-12-27
| | | | | | | | | | | | | | | | | | | | | - Eta reduce `mapAttrsRecursiveCond`, `foldAttrs`, `getAttrFromPath`. - Modify `matchAttrs` to use `elemAt` instead of `head (tail xs)` to access elements. - Modify `matchAttrs` to use `any id` instead of `foldr and true`.