forked from mirrors/gomod2nix
Merge pull request #61 from adisbladis/nix-reference-docs
Add Nix reference docs
This commit is contained in:
commit
c5da508f3c
3 changed files with 23 additions and 3 deletions
|
@ -25,7 +25,7 @@ in pkgs.buildGoApplication {
|
|||
}
|
||||
```
|
||||
|
||||
For more in-depth usage check the [Getting Started](./docs/getting-started.md) docs.
|
||||
For more in-depth usage check the [Getting Started](./docs/getting-started.md) and the [Nix API reference](./docs/nix-reference.md) docs.
|
||||
|
||||
## FAQ
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ let
|
|||
};
|
||||
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
stdenv.mkDerivation (builtins.removeAttrs attrs [ "pwd" ] // {
|
||||
name = "${builtins.baseNameOf goMod.module}-env";
|
||||
|
||||
dontUnpack = true;
|
||||
|
@ -170,7 +170,7 @@ let
|
|||
|
||||
${internal.install}
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
buildGoApplication =
|
||||
{ modules ? pwd + "/gomod2nix.toml"
|
||||
|
|
20
docs/nix-reference.md
Normal file
20
docs/nix-reference.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Gomod2nix Nix API
|
||||
|
||||
## Public functions
|
||||
|
||||
### buildGoApplication
|
||||
Arguments:
|
||||
- **modules** Path to gomod2nix.toml (_default: `pwd + "/gomod2nix.toml"`).
|
||||
- **src** Path to sources (_default: `pwd`).
|
||||
- **pwd** Path to working directory (_default: `null`).
|
||||
- **go** The Go compiler to use (can be omitted).
|
||||
- **subPackages** Only build these specific sub packages.
|
||||
- **allowGoReference** Allow references to the Go compiler in the output closure (_default: `false`).
|
||||
|
||||
All other arguments are passed verbatim to `stdenv.mkDerivation`.
|
||||
|
||||
### mkGoEnv
|
||||
Arguments:
|
||||
- **pwd** Path to working directory.
|
||||
|
||||
All other arguments are passed verbatim to `stdenv.mkDerivation`.
|
Loading…
Reference in a new issue