Commit Graph

3004 Commits

Author SHA1 Message Date
Robert Hensing
e99021ff75 trivial-builders: Deduplicate docs
I didn't have the opportunity to do all work at once, so I've added
TODOs to bring attention to the situation.
2024-03-11 11:33:14 +01:00
adisbladis
434df3c94b
Merge pull request #289231 from adisbladis/fetchnpmlock
importNpmLock: init
2024-03-08 15:14:37 +13:00
Matthieu Coudron
0bdfbc9e6a doc/lua.section.md: update lua documentation 2024-03-06 22:54:01 +01:00
Philip Taron
86ae7a6243
Remove top level with lib; in docs (#293829) 2024-03-06 22:35:43 +01:00
Anderson Torres
e671d3bbbd Nix docs: remove with lib; from example code
Following [Best Practices](https://nix.dev/guides/best-practices#with-scopes),
`with` is a problematic language construction and should be avoided.

Usually it is employed like a "factorization": `[ X.A X.B X.C X.D ]` is written
`with X; [ A B C D ]`.

However, as shown in the link above, the syntatical rules of `with` are not so
intuitive, and this "distributive rule" is very selective, in the sense that
`with X; [ A B C D ]` is not equivalent to `[ X.A X.B X.C X.D ]`.

However, this factorization is still useful to "squeeze" some code, especially
in lists like `meta.maintainers`.

On the other hand, it becomes less justifiable in bigger scopes. This is
especially true in cases like `with lib;` in the top of expression and in sets
like `meta = with lib; { . . . }`.

That being said, this patch removes most of example code in the current
documentation.

The exceptions are, for now
- doc/functions/generators.section.md
- doc/languages-frameworks/coq.section.md

because, well, they are way more complicated, and I couldn't parse them
mentally - yet another reason why `with` should be avoided!
2024-03-06 11:40:09 -03:00
Martin Weinelt
14a12caecf
python38: remove
The end of life for Python 3.8 is scheduled for 2024/10. As such it
cannot be a part of NixOS 24.05, because its support cycle goes past
that.
2024-03-05 11:56:21 +01:00
Leon
0bb74f147b
doc: small fix for nightly in derivation snippet (#292688) 2024-03-04 15:44:39 -08:00
adisbladis
b6e4b86809 importNpmLock: init
This is an alternative to `fetchNpmDeps` that is notably different in that it uses metadata from `package.json` & `package-lock.json` instead of specifying a fixed-output hash.

Notable features:
- IFD free.
- Only fetches a node dependency once. No massive FODs.
- Support for URL, Git and path dependencies.
- Uses most of the existing `npmHooks`

`importNpmLock` can be used _only_ in the cases where we need to check in a `package-lock.json` in the tree.
Currently this means that we have 13 packages that would be candidates to use this function, though I expect most usage to be in private repositories.

This is upstreaming the builder portion of https://github.com/adisbladis/buildNodeModules into nixpkgs (different naming but the code is the same).
I will archive this repository and consider nixpkgs the new upstream once it's been merged.

For more explanations and rationale see https://discourse.nixos.org/t/buildnodemodules-the-dumbest-node-to-nix-packaging-tool-yet/35733

Example usage:
``` nix
stdenv.mkDerivation {
  pname = "my-nodejs-app";
  version = "0.1.0";

  src = ./.;

  nativeBuildInputs = [
    importNpmLock.hooks.npmConfigHook
    nodejs
    nodejs.passthru.python # for node-gyp
    npmHooks.npmBuildHook
    npmHooks.npmInstallHook
  ];

  npmDeps = buildNodeModules.fetchNodeModules {
    npmRoot = ./.;
  };
}
```
2024-03-05 12:23:28 +13:00
K900
9bea2c4d93
Merge pull request #293163 from Aleksanaa/doc/qt
doc/qt: minor fixes
2024-03-04 10:52:45 +03:00
aleksana
cdc9e1d100 doc/qt: minor fixes 2024-03-04 15:50:03 +08:00
DS
62552e3683 doc: update docs for portableService, follow doc conventions 2024-02-29 17:10:01 +01:00
Silvan Mosberger
67e55070eb
Merge pull request #290886 from DanielSidhion/update-ocitools
doc: update docs in ociTools, follow doc conventions
2024-02-29 16:32:36 +01:00
DS
c73de6fac3 doc: update docs in ociTools, follow doc conventions 2024-02-29 16:30:04 +01:00
Daniel Sidhion
3ef3dbe6d5
Merge pull request #291715 from DanielSidhion/document-private-key
doc: document publicly-known private key for darwin.linux-builder
2024-02-28 06:37:18 -08:00
yihuang
267735f785
doc: fix darwin-builder doc (#291518) 2024-02-28 06:36:13 -08:00
Robert Hensing
57c1108204
Merge pull request #282886 from WxNzEMof/docker-tools-uid
Allow streaming layered containers with non-root Nix store
2024-02-28 03:43:07 +01:00
DS
fced134442 doc: document publicly-known private key for darwin.linux-builder 2024-02-26 17:37:53 -08:00
WxNzEMof
7799f4695b Document the new streamLayeredImage parameters 2024-02-26 18:41:07 +00:00
Mihai Maruseac
c786e63c70
doc: Fix typo resulting in broken link in manual
I was looking at
https://nixos.org/manual/nixpkgs/stable/#buildpythonpackage-parameters to
import a Python package and noticed that the link for the `hooks` in
`pyproject` option is broken due to a typo (used <kbd>0</kbd> instead of
<kbd>)</kbd>).

Signed-off-by: Mihai Maruseac <mihai.maruseac@gmail.com>
2024-02-26 05:20:16 -08:00
Weijia Wang
5f5062d1ef Merge branch 'master' into staging-next 2024-02-23 05:09:55 +01:00
Matthieu Coudron
0c3eca2682
doc/fetchers: document downloadToTemp for fetchurl (#288762)
* doc/fetchers: document downloadToTemp for fetchurl

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-02-22 16:10:21 +01:00
github-actions[bot]
ba5eeff4f5
Merge master into staging-next 2024-02-20 06:01:15 +00:00
Martin Weinelt
fa83add1b9
Merge pull request #271597 from adisbladis/python-runtime-build-time-sep
python3.pkgs.buildPythonPackage: Separate runtime & build time dependencies
2024-02-20 05:05:20 +01:00
github-actions[bot]
2d9ce4a9af
Merge master into staging-next 2024-02-19 18:01:11 +00:00
Robert Hensing
d2dfcfcfad
Merge pull request #289584 from athre0z/docker-zstd
dockerTools: configurable compression schema
2024-02-19 18:06:54 +01:00
adisbladis
4d0cca4654 mk-python-derivation: Add build-system argument
Much like the previous commit that adds dependencies &
optional-dependencies this aligns PEP-517 build systems with how they
are defined in PEP-518/PEP-621.

The naming `build-system` (singular) is aligned with upstream Python standards.
2024-02-18 17:40:42 +13:00
adisbladis
b9138b7c07 mk-python-derivation: Add dependencies & optional-dependencies arguments
Since https://github.com/NixOS/nixpkgs/pull/161835 we've had the
concept of `passthru.optional-dependencies` for Python optional deps.

Having to explicitly put optional-dependencies in the passthru attrset
is a bit strange API-wise, even though it semantically makes sense.

This change unifies the handling of non-optional & optional Python
dependencies using the names established from PEP-621 (standardized pyproject.toml project metadata).
2024-02-18 17:40:42 +13:00
Joel Höner
4b603ad9cd dockerTools: configurable compression schema
This commit adds support for swapping out the compression algorithm
used in all major docker-tools commands that generate images. The
default algorithm remains unchanged (gzip).
2024-02-17 18:52:42 +01:00
Matthieu Coudron
50e877ed89 buildLuarocksPackage: accept structured luarocks config
There is an arbitrary mapping being done right now between
nixpkgs lua infrastructre and luarocks config schema.
This is confusing if you use lua so let's make it possible to use the
lua names in the nixpkgs, thanks to the lib.generators.toLua convertor.

The only nixpkgs thing to remember should be to put the config into `luarocksConfig`

`buildLuarocksPackage.extraVariables` should become `buildLuarocksPackage.luarocksConfig.variables`
2024-02-17 15:58:13 +01:00
github-actions[bot]
2035b66b68
Merge staging-next into staging 2024-02-15 18:01:39 +00:00
Silvan Mosberger
298083e3b4
Merge pull request #288414 from DanielSidhion/last-dockertools-fixes
doc: update dockerTools to use long-form docker commands, improve wording
2024-02-15 16:16:26 +01:00
Silvan Mosberger
882a2fb83f
Merge pull request #288681 from thanegill/patch-6
Docs: Fix syntax error in darwin-builder.section.md
2024-02-15 16:14:39 +01:00
Silvan Mosberger
fc407cfdf9
Merge pull request #287331 from booniepepper/doc/prefer-cargoHash-attribute
doc: consistently prefer and lead with cargoHash over cargoSha256
2024-02-15 16:14:03 +01:00
Thane Gill
9d22da290a
Fix syntax error in darwin-builder.section.md 2024-02-13 14:07:27 -08:00
lassulus
38905fc7ee
Merge pull request #287957 from DavHau/python
pythonCatchConflictsHook: scan $out, not sys.path (2)
2024-02-13 14:22:53 +07:00
DavHau
a299915fff pythonCatchConflictsHook: improve docs 2024-02-13 11:15:41 +07:00
DS
ba79b098ea doc: use long-form docker commands, improve wording 2024-02-12 15:38:00 -08:00
K900
4dd212239e
Merge pull request #287169 from K900/qt-docs
doc/qt: refresh
2024-02-12 14:47:20 +03:00
K900
76081bed3a doc/qt: refresh
Make examples don't require a custom callPackage, remove note on multiversioning, reword a few things.

Fixes #287015
2024-02-11 11:02:39 +03:00
Justin "J.R." Hill
0f7d690e48
doc: consistently prefer and lead with cargoHash over cargSha256 2024-02-08 15:41:32 -08:00
DS
5677230de3 doc: update buildNixShellImage docs, add streamNixShellImage docs 2024-02-08 07:49:16 -08:00
Silvan Mosberger
b94e9dd7a5
Merge pull request #285223 from DanielSidhion/update-dockertools-envhelpers
doc: update environment helpers in dockerTools docs, add fakeNss section
2024-02-08 16:31:33 +01:00
Silvan Mosberger
39452ae8af
Merge pull request #286483 from ysndr/fix/doc/installmanpage/output
fix: include reference and link to `outputMan` in the doc of `installManPage`
2024-02-08 16:28:46 +01:00
Silvan Mosberger
50cb21e1dc
Merge pull request #285655 from itslychee/revision/dotnet-docs
doc: clarify usage of nuget-to-nix in dotnet.section.md
2024-02-08 16:27:31 +01:00
Yannik Sander
ae9e8a4b83
fix: include reference and link to outputMan 2024-02-05 13:35:49 +01:00
Weijia Wang
8e45a04cc3
Merge pull request #284632 from OPNA2608/fix/dart-docs-unstableVersion
docs/dart: Update unstable version example
2024-02-04 21:39:13 +01:00
lychee
38048e0fbe
doc: clarify usage of nuget-to-nix in dotnet.section.md
I believe it would be helpful to better explain how to use
`nuget-to-nix` for those who aren't familar with the .NET ecosystem as I
was personally stumped on how to use it.
2024-02-04 14:08:11 -06:00
Mario Rodas
1be8478d00
Merge pull request #283080 from marsam/postgresql-test-hook-settings
postgresqlTestHook: add postgresqlExtraSettings variable
2024-02-04 06:36:16 -05:00
Shea Levy
43ec00acab
Merge branch 'optionalDrvAttr' 2024-02-02 16:30:17 -05:00
Shea Levy
ca1262a483
lib: Add optionalDrvAttr to conditionally set drv attributes.
This allows for adding new, conditionally set, derivation attributes
to an existing derivation without changing any output paths in the
case where the condition is not met.
2024-02-02 16:27:30 -05:00