Go: Difference between revisions
m use monospace formatting where applicable, add more links, update link to the Go homepage |
m fix indentation |
||
| Line 63: | Line 63: | ||
==== Example (local source) ==== | ==== Example (local source) ==== | ||
If you want to build a local project with Nix, replace the <code>src</code> attribute to be the local directory, e.g.:<syntaxhighlight lang="nix"> | If you want to build a local project with Nix, replace the <code>src</code> attribute to be the local directory, e.g.:<syntaxhighlight lang="nix"> | ||
some-package = buildGoModule { | |||
src = ./. | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 72: | Line 72: | ||
to change the source root, use | to change the source root, use | ||
<syntaxhighlight lang=nix> | <syntaxhighlight lang=nix> | ||
some-package = buildGoModule { | |||
src = fetchFromGitHub { | |||
# ... | # ... | ||
}; | } + "/path/to/module"; | ||
# ... | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 85: | Line 85: | ||
which is linked with | which is linked with | ||
<syntaxhighlight lang=nix> | <syntaxhighlight lang=nix> | ||
some-package = buildGoPackage { | |||
# ... | |||
goDeps = ./deps.nix; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||