fix flake for macos, fix jemalloc/hmalloc builds
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
05477150a2
commit
30b5142ecc
1 changed files with 11 additions and 18 deletions
29
flake.nix
29
flake.nix
|
@ -197,7 +197,7 @@
|
||||||
CARGO_PROFILE = profile;
|
CARGO_PROFILE = profile;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkOciImage = pkgs: package: allocator:
|
mkOciImage = pkgs: package:
|
||||||
pkgs.dockerTools.buildLayeredImage {
|
pkgs.dockerTools.buildLayeredImage {
|
||||||
name = package.pname;
|
name = package.pname;
|
||||||
tag = "main";
|
tag = "main";
|
||||||
|
@ -209,10 +209,10 @@
|
||||||
config = {
|
config = {
|
||||||
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
|
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
|
||||||
# are handled as expected
|
# are handled as expected
|
||||||
Entrypoint = [
|
Entrypoint = if !pkgs.stdenv.isDarwin then [
|
||||||
"${pkgs.lib.getExe' pkgs.tini "tini"}"
|
"${pkgs.lib.getExe' pkgs.tini "tini"}"
|
||||||
"--"
|
"--"
|
||||||
];
|
] else [];
|
||||||
Cmd = [
|
Cmd = [
|
||||||
"${pkgs.lib.getExe package}"
|
"${pkgs.lib.getExe package}"
|
||||||
];
|
];
|
||||||
|
@ -290,10 +290,10 @@
|
||||||
''
|
''
|
||||||
];
|
];
|
||||||
|
|
||||||
Entrypoint = [
|
Entrypoint = if !pkgs.stdenv.isDarwin then [
|
||||||
"${pkgs.lib.getExe' pkgs.tini "tini"}"
|
"${pkgs.lib.getExe' pkgs.tini "tini"}"
|
||||||
"--"
|
"--"
|
||||||
];
|
] else [];
|
||||||
|
|
||||||
Env = [
|
Env = [
|
||||||
"SSL_CERT_FILE=/complement/ca/ca.crt"
|
"SSL_CERT_FILE=/complement/ca/ca.crt"
|
||||||
|
@ -314,9 +314,9 @@
|
||||||
default = mkPackage pkgsHost null "" "release";
|
default = mkPackage pkgsHost null "" "release";
|
||||||
jemalloc = mkPackage pkgsHost "jemalloc" "" "release";
|
jemalloc = mkPackage pkgsHost "jemalloc" "" "release";
|
||||||
hmalloc = mkPackage pkgsHost "hmalloc" "" "release";
|
hmalloc = mkPackage pkgsHost "hmalloc" "" "release";
|
||||||
oci-image = mkOciImage pkgsHost self.packages.${system}.default null;
|
oci-image = mkOciImage pkgsHost self.packages.${system}.default;
|
||||||
oci-image-jemalloc = mkOciImage pkgsHost self.packages.${system}.default "jemalloc";
|
oci-image-jemalloc = mkOciImage pkgsHost self.packages.${system}.default;
|
||||||
oci-image-hmalloc = mkOciImage pkgsHost self.packages.${system}.default "hmalloc";
|
oci-image-hmalloc = mkOciImage pkgsHost self.packages.${system}.default;
|
||||||
|
|
||||||
book =
|
book =
|
||||||
let
|
let
|
||||||
|
@ -388,8 +388,7 @@
|
||||||
name = "oci-image-${crossSystem}";
|
name = "oci-image-${crossSystem}";
|
||||||
value = mkOciImage
|
value = mkOciImage
|
||||||
pkgsCrossStatic
|
pkgsCrossStatic
|
||||||
self.packages.${system}.${binaryName}
|
self.packages.${system}.${binaryName};
|
||||||
null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# An output for an OCI image based on that binary with jemalloc
|
# An output for an OCI image based on that binary with jemalloc
|
||||||
|
@ -397,8 +396,7 @@
|
||||||
name = "oci-image-${crossSystem}-jemalloc";
|
name = "oci-image-${crossSystem}-jemalloc";
|
||||||
value = mkOciImage
|
value = mkOciImage
|
||||||
pkgsCrossStatic
|
pkgsCrossStatic
|
||||||
self.packages.${system}.${binaryName}
|
self.packages.${system}.${binaryName};
|
||||||
"jemalloc";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# An output for an OCI image based on that binary with hardened_malloc
|
# An output for an OCI image based on that binary with hardened_malloc
|
||||||
|
@ -406,18 +404,13 @@
|
||||||
name = "oci-image-${crossSystem}-hmalloc";
|
name = "oci-image-${crossSystem}-hmalloc";
|
||||||
value = mkOciImage
|
value = mkOciImage
|
||||||
pkgsCrossStatic
|
pkgsCrossStatic
|
||||||
self.packages.${system}.${binaryName}
|
self.packages.${system}.${binaryName};
|
||||||
"hmalloc";
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
"x86_64-unknown-linux-musl"
|
"x86_64-unknown-linux-musl"
|
||||||
"x86_64-unknown-linux-musl-jemalloc"
|
|
||||||
"x86_64-unknown-linux-musl-hmalloc"
|
|
||||||
"aarch64-unknown-linux-musl"
|
"aarch64-unknown-linux-musl"
|
||||||
"aarch64-unknown-linux-musl-jemalloc"
|
|
||||||
"aarch64-unknown-linux-musl-hmalloc"
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue