Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
}:
|
|
|
|
buildGoModule {
|
|
name = "hello-go";
|
|
|
|
src = ./src;
|
|
|
|
vendorHash = null;
|
|
|
|
env.CGO_ENABLED = 0;
|
|
|
|
# go installs binary into $out/bin/$GOOS_$GOARCH/hello-go in cross compilation
|
|
postInstall = ''
|
|
[[ -f "$out/bin/hello-go" ]] || ln -s ./''${GOOS}_''${GOARCH}/hello-go $out/bin/hello-go
|
|
'';
|
|
|
|
meta = {
|
|
description = "Simple program printing hello world in Go";
|
|
longDescription = ''
|
|
hello-go is a simple program printing "Hello, world!" written in Go,
|
|
aiming at testing programs that involves analyzing executables or
|
|
emulating foreign architectures, without pulling in a heavy cross
|
|
toolchain.
|
|
|
|
Specify target platform by setting GOOS and GOARCH:
|
|
|
|
```nix
|
|
hello-go.overrideAttrs (previousAttrs: {
|
|
env = previousAttrs.env or { } // {
|
|
GOOS = "linux";
|
|
GOARCH = "arm64";
|
|
};
|
|
})
|
|
```
|
|
|
|
See https://pkg.go.dev/internal/platform#pkg-variables for a list
|
|
of available platforms.
|
|
'';
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ aleksana ];
|
|
mainProgram = "hello-go";
|
|
};
|
|
}
|