|
|
@ -183,33 +183,44 @@
|
|
|
|
{
|
|
|
|
{
|
|
|
|
packages = {
|
|
|
|
packages = {
|
|
|
|
default = package pkgsHost;
|
|
|
|
default = package pkgsHost;
|
|
|
|
|
|
|
|
|
|
|
|
oci-image = mkOciImage pkgsHost self.packages.${system}.default;
|
|
|
|
oci-image = mkOciImage pkgsHost self.packages.${system}.default;
|
|
|
|
|
|
|
|
}
|
|
|
|
# Build an OCI image from the musl aarch64 build so we don't have to
|
|
|
|
//
|
|
|
|
# build for aarch64 twice (to make a gnu version specifically for the
|
|
|
|
builtins.listToAttrs
|
|
|
|
# OCI image)
|
|
|
|
(builtins.concatLists
|
|
|
|
oci-image-aarch64-unknown-linux-musl = mkOciImage
|
|
|
|
(builtins.map
|
|
|
|
pkgsHost
|
|
|
|
(crossSystem:
|
|
|
|
self.packages.${system}.static-aarch64-unknown-linux-musl;
|
|
|
|
let
|
|
|
|
|
|
|
|
binaryName = "static-${crossSystem}";
|
|
|
|
# Don't build a musl x86_64 OCI image because that would be pointless.
|
|
|
|
pkgsCrossStatic =
|
|
|
|
# Just use the gnu one (i.e. `self.packages."x86_64-linux".oci-image`).
|
|
|
|
(import nixpkgs {
|
|
|
|
} // builtins.listToAttrs (
|
|
|
|
|
|
|
|
builtins.map
|
|
|
|
|
|
|
|
(crossSystem: {
|
|
|
|
|
|
|
|
name = "static-${crossSystem}";
|
|
|
|
|
|
|
|
value = package (import nixpkgs {
|
|
|
|
|
|
|
|
inherit system;
|
|
|
|
inherit system;
|
|
|
|
crossSystem = {
|
|
|
|
crossSystem = {
|
|
|
|
config = crossSystem;
|
|
|
|
config = crossSystem;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}).pkgsStatic;
|
|
|
|
}).pkgsStatic;
|
|
|
|
})
|
|
|
|
in
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
# An output for a statically-linked binary
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name = binaryName;
|
|
|
|
|
|
|
|
value = package pkgsCrossStatic;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# An output for an OCI image based on that binary
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name = "oci-image-${crossSystem}";
|
|
|
|
|
|
|
|
value = mkOciImage
|
|
|
|
|
|
|
|
pkgsCrossStatic
|
|
|
|
|
|
|
|
self.packages.${system}.${binaryName};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
)
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"x86_64-unknown-linux-musl"
|
|
|
|
"x86_64-unknown-linux-musl"
|
|
|
|
"aarch64-unknown-linux-musl"
|
|
|
|
"aarch64-unknown-linux-musl"
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
devShells.default = pkgsHost.mkShell {
|
|
|
|
devShells.default = pkgsHost.mkShell {
|
|
|
|