| 1 |
{ |
| 2 |
# dependencies |
| 3 |
stdenv, fetchurl, nix-gitignore, buildGoModule, |
| 4 |
|
| 5 |
# args |
| 6 |
localFiles ? false |
| 7 |
}: |
| 8 |
|
| 9 |
buildGoModule rec { |
| 10 |
|
| 11 |
pname = "hello"; |
| 12 |
version = "1.0"; |
| 13 |
|
| 14 |
src = ( |
| 15 |
if localFiles then |
| 16 |
nix-gitignore.gitignoreSource [ "result" ] ./. |
| 17 |
else |
| 18 |
fetchurl { |
| 19 |
url = "https://example.com"; |
| 20 |
sha256 = stdenv.lib.fakeSha256; |
| 21 |
} |
| 22 |
); |
| 23 |
|
| 24 |
modSha256 = "1ggp6xhhlixihjx37v5j9gd3sa1gymqrglf9c3j1pwfnym1k99y3"; |
| 25 |
|
| 26 |
subPackages = [ "." ]; |
| 27 |
|
| 28 |
passthru = { |
| 29 |
executable = "main"; |
| 30 |
}; |
| 31 |
|
| 32 |
meta = with stdenv.lib; { |
| 33 |
description = "Hello world example in Go"; |
| 34 |
longDescription = '' |
| 35 |
Long description for Hello world example in Go. |
| 36 |
''; |
| 37 |
homepage = https://blog.golang.org/using-go-modules; |
| 38 |
license = licenses.asl20; |
| 39 |
maintainers = []; |
| 40 |
platforms = platforms.all; |
| 41 |
}; |
| 42 |
} |
| 43 |
|
| 44 |
# From https://github.com/vlktomas/nix-examples/tree/master/desktop/Go/hello |
| 45 |
|