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
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
version = "22.11";
|
|
|
|
rev = "ce20e9ebe1903ea2ba1ab006ec63093020c761cb";
|
|
|
|
|
|
|
|
src = fetchTarball {
|
|
|
|
name = "nixpkgs-${version}";
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
|
|
|
|
sha256 = "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=";
|
|
|
|
};
|
|
|
|
|
2023-03-25 14:58:20 +00:00
|
|
|
supportedSystems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
#"armv7l-linux-musl" # rpi, I think?
|
|
|
|
"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
|
|
|
}
|