mirror of
https://github.com/nix-community/naersk
synced 2024-11-10 06:04:17 +00:00
Update README and limit concurrent builds
This commit is contained in:
parent
59352d86f5
commit
648f8c9cce
3 changed files with 31 additions and 2 deletions
|
@ -130,4 +130,3 @@ Copy this `flake.nix` into your repo.
|
|||
}
|
||||
|
||||
```
|
||||
|
||||
|
|
|
@ -72,3 +72,33 @@ naersk.buildPackage ./my-package
|
|||
|
||||
[cargo]: https://crates.io/
|
||||
[niv]: https://github.com/nmattia/niv
|
||||
|
||||
## Using with Nix Flakes
|
||||
Copy this `flake.nix` into your repo.
|
||||
```nix
|
||||
{
|
||||
|
||||
inputs = {
|
||||
naersk.url = "github:nmattia/naersk/master";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
in {
|
||||
|
||||
defaultPackage = naersk-lib.buildPackage ./.;
|
||||
|
||||
# If you have a default binary in your project, add path to it here
|
||||
# defaultApp = {
|
||||
# type = "app";
|
||||
# program = "${self.defaultPackage."${system}"}/bin/%BINARY_PATH_HERE%";
|
||||
# };
|
||||
});
|
||||
}
|
||||
|
||||
```
|
||||
|
|
|
@ -34,6 +34,6 @@ else
|
|||
fi
|
||||
|
||||
# Build and create a root
|
||||
nix-build ./test.nix --no-link --max-jobs 10 "${extraArgs[@]}"
|
||||
nix-build ./test.nix --no-link --max-jobs 4 "${extraArgs[@]}"
|
||||
|
||||
echo "all good"
|
||||
|
|
Loading…
Reference in a new issue