2023-02-14 19:46:28 +00:00
|
|
|
rec {
|
|
|
|
|
|
|
|
overlays = [
|
|
|
|
|
|
|
|
# Make buildGoModules use static compilation by default
|
|
|
|
(final: prev: let
|
|
|
|
buildArgs = {
|
|
|
|
doCheck = false;
|
|
|
|
CGO_ENABLED=0;
|
|
|
|
tags = [ "netgo" "timetzdata" ];
|
|
|
|
ldflags = [ "-w" "-extldflags=-static" ];
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
buildGoModule = args: prev.buildGoModule (buildArgs // args);
|
|
|
|
})
|
|
|
|
|
|
|
|
# for whatever reason git checks fail when flake is being used (or maybe
|
|
|
|
# it's crossSystem's fault)
|
|
|
|
(final: prev: {
|
|
|
|
git = prev.git.overrideAttrs (oldAttrs: {
|
|
|
|
installCheckPhase = ''
|
|
|
|
# noop
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
|
2024-06-10 14:01:27 +00:00
|
|
|
version = "24.05";
|
|
|
|
rev = "5646423bfac84ec68dfc60f2a322e627ef0d6a95";
|
2023-02-14 19:46:28 +00:00
|
|
|
|
|
|
|
src = fetchTarball {
|
|
|
|
name = "nixpkgs-${version}";
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
2024-06-10 14:01:27 +00:00
|
|
|
sha256 = "sha256:1lr1h35prqkd1mkmzriwlpvxcb34kmhc9dnr48gkm8hh089hifmx";
|
2023-02-14 19:46:28 +00:00
|
|
|
};
|
|
|
|
|
2023-03-25 14:58:20 +00:00
|
|
|
supportedSystems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"i686-linux"
|
|
|
|
];
|
|
|
|
|
2023-02-14 19:46:28 +00:00
|
|
|
default = {
|
|
|
|
buildSystem,
|
2023-03-25 14:58:20 +00:00
|
|
|
hostSystem ? buildSystem,
|
2023-03-25 15:18:52 +00:00
|
|
|
}: import src ({
|
|
|
|
|
|
|
|
inherit overlays;
|
2023-02-14 19:46:28 +00:00
|
|
|
system = buildSystem;
|
2023-03-25 15:18:52 +00:00
|
|
|
|
|
|
|
} // (if buildSystem == hostSystem then {} else {
|
|
|
|
|
|
|
|
# The nixpkgs cache doesn't have any packages where cross-compiling has been
|
|
|
|
# enabled, even if the target platform is actually the same as the build
|
|
|
|
# platform (and therefore it's not really cross-compiling). So we only set
|
|
|
|
# up the cross-compiling config if the target platform is different.
|
2023-02-14 19:46:28 +00:00
|
|
|
crossSystem.config = hostSystem;
|
2023-03-25 15:18:52 +00:00
|
|
|
|
|
|
|
}));
|
2023-02-14 19:46:28 +00:00
|
|
|
}
|