Skip to content

Commit

Permalink
better gobuildmodule
Browse files Browse the repository at this point in the history
  • Loading branch information
dav009 committed Sep 23, 2023
1 parent 997a70f commit a09f7de
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions flake.nix
Expand Up @@ -17,25 +17,26 @@
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });

in
{

packages = forAllSystems
(system:
let
pkgs = nixpkgsFor.${system};
in rec {
bqt = pkgs.buildGoModule {
pname = "bqt";
inherit version;
src = ./.;
CGO_ENABLED = 1;
vendorSha256 =
"sha256-sjg+D0IIErl21HZjXBNKBTqXBZfy6w6EhHYS0seUE3k=";
};
default = bqt;
});
in {

packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in rec {
bqt = pkgs.buildGoModule {
pname = "bqt";
inherit version;
src = ./.;
CGO_ENABLED = 1;
preBuild = ''
export CXX = "clang++";
export CC = "clang";
'';
vendorSha256 =
"sha256-sjg+D0IIErl21HZjXBNKBTqXBZfy6w6EhHYS0seUE3k=";
nativeCheckInputs = with pkgs; [ clang_14 ];
};
default = bqt;
});

apps = forAllSystems (system: rec {
bqt = {
Expand All @@ -53,7 +54,14 @@
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
buildInputs = with pkgs; [ go_1_21 gopls gotools golint clang_14 goreleaser ];
buildInputs = with pkgs; [
go_1_21
gopls
gotools
golint
clang_14
goreleaser
];
GOROOT = "${pkgs.go_1_21}/share/go";
CGO_ENABLED = "1";
CXX = "clang++";
Expand Down

0 comments on commit a09f7de

Please sign in to comment.