Update README and limit concurrent builds

This commit is contained in:
Nicolas Mattia 2020-08-10 11:24:36 +02:00
parent 59352d86f5
commit 648f8c9cce
3 changed files with 31 additions and 2 deletions

View file

@ -130,4 +130,3 @@ Copy this `flake.nix` into your repo.
} }
``` ```

View file

@ -72,3 +72,33 @@ naersk.buildPackage ./my-package
[cargo]: https://crates.io/ [cargo]: https://crates.io/
[niv]: https://github.com/nmattia/niv [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%";
# };
});
}
```

View file

@ -34,6 +34,6 @@ else
fi fi
# Build and create a root # 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" echo "all good"