I have a simple Nix Flake shell with the SQLite dependencies required to access the database, but I am unable to compile the code due to the following error:
go build -o ocean-market cmd/main.go
# runtime/cgo
flag provided but not defined: -E
Go is a tool for managing Go source code.
Usage:
go <command> [arguments]
my nix flake is
{
description = "PoC";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix = {
url = "github:tweag/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.follows = "utils";
};
};
outputs = { self, nixpkgs, flake-utils, gomod2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default ];
};
in
{
packages = {
default = pkgs.gnumake;
};
formatter = pkgs.nixpkgs-fmt;
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
gcc
glibc.dev
go
gopls
gotools
go-tools
gomod2nix.packages.${system}.default
golangci-lint
protobuf3_20
];
buildPhase = "make";
shellHook = ''
export CGO_ENABLED=1
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
make dep
'';
};
}
);
}