Skip to content

Commit

Permalink
Add pistol-static compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
doronbehar committed Oct 20, 2021
1 parent c7a8aee commit efd97ce
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,29 @@
;
CGO_ENABLED = 1;
};
pistol-static = pistol.overrideAttrs(oldAttrs: {
pname = "pistol-static";
inherit (pistol)
version
src
nativeBuildInputs
subPackages
postBuild
CGO_ENABLED
modules
meta
;
buildFlagsArray = pistol.buildFlagsArray + ''
-L${pkgs.glibc.static}/lib
'';
buildInputs = [
pkgs.glibc.static
pkgs.pkgsStatic.file
pkgs.pkgsStatic.zlib
];
# CFLAGS = "-I${pkgs.glibc.static.dev}/include -I${pkgs.pkgsStatic.file}/include -I${pkgs.pkgsStatic.zlib}/include";
# LDFLAGS = "-L${pkgs.glibc.static}/lib -L${pkgs.pkgsStatic.file}/lib -L${pkgs.pkgsStatic.zlib}/lib";
});
in rec {
devShell = pkgs.mkShell {
inherit (pistol) buildInputs;
Expand All @@ -88,7 +111,12 @@
pkgs.gomod2nix
];
};
packages.pistol = pistol;
packages = {
inherit
pistol
pistol-static
;
};
defaultPackage = pistol;
apps.pistol = {
type = "app";
Expand Down

0 comments on commit efd97ce

Please sign in to comment.