Jump to content

Nixpkgs/Contributing: Difference between revisions

+ Run tests locally
imported>R-burns
m (Driveby stdenv.lib deprecation cleanup: https://github.com/NixOS/nixpkgs/issues/108938)
imported>Milahu
(+ Run tests locally)
Line 15: Line 15:
==== Fork Nixpkgs on Github ====
==== Fork Nixpkgs on Github ====


Create a GitHub account and fork nixpkgs/nixos/... repository.  
Create a GitHub account and fork the [https://github.com/NixOS/nixpkgs nixpkgs repository].  


==== Add a remote ====
==== Add a remote ====
Line 50: Line 50:
git status
git status
</syntaxhighlight>
</syntaxhighlight>
==== Run tests locally ====
Pushing commits to Github will run tests on Github.<br>
We can run these tests locally, to reduce "commit noise" from failing tests
<pre>
cd nixpkgs
# Basic evaluation checks
nix-build pkgs/top-level/release.nix -A tarball.nixpkgs-basic-release-checks \
--arg supportedSystems '[ "aarch64-darwin" "aarch64-linux" "x86_64-linux" "x86_64-darwin"  ]'
# list all derivations
nix-env --query --available --out-path --file ./. --show-trace
# build
nix-build -A $yourpackage
</pre>
Tests on Github:
* [https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/basic-eval.yml Basic evaluation checks]
* [https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/editorconfig.yml Checking EditorConfig]
** Read https://editorconfig.org/#download to configure your editor
* [https://github.com/NixOS/ofborg#how-does-ofborg-call-nix-build ofborg-eval] will call <code>nix-build -A $yourpackage</code>


==== Push to your remote repository ====
==== Push to your remote repository ====
Anonymous user