aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-05-11 09:27:49 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-05-11 09:27:49 +0200
commit024d8df847ce720f0ec76b288c7a0142672d21f2 (patch)
tree309d8e379e61dd67e38aa79dd428befdbec6c99d
parent76d02fe3008a67f08bc438a932df61f9ef6ca5a0 (diff)
downloadaerogramme-024d8df847ce720f0ec76b288c7a0142672d21f2.tar.gz
aerogramme-024d8df847ce720f0ec76b288c7a0142672d21f2.zip
dockernix-build
-rw-r--r--flake.nix32
1 files changed, 29 insertions, 3 deletions
diff --git a/flake.nix b/flake.nix
index 6c26087..55aacd7 100644
--- a/flake.nix
+++ b/flake.nix
@@ -103,15 +103,41 @@
});
# binary extract
- # @TODO
+ bin = pkgs.stdenv.mkDerivation {
+ pname = "aerogramme-bin";
+ version = "0.0.1";
+ dontUnpack = true;
+ dontBuild = true;
+ installPhase = ''
+ cp ${(rustRelease.workspace.aerogramme {}).bin}/bin/aerogramme $out
+ '';
+ };
# docker packaging
- # @TODO
+ archMap = {
+ "x86_64-unknown-linux-musl" = {
+ GOARCH = "amd64";
+ };
+ "aarch64-unknown-linux-musl" = {
+ GOARCH = "arm64";
+ };
+ "armv6l-unknown-linux-musleabihf" = {
+ GOARCH = "arm";
+ };
+ };
+ container = pkgs.dockerTools.buildImage {
+ name = "dxflrs/aerogramme";
+ architecture = (builtins.getAttr targetHost archMap).GOARCH;
+ config = {
+ Cmd = [ "${bin}" ];
+ };
+ };
in {
devShells.default = shell;
packages.debug = (rustDebug.workspace.aerogramme {}).bin;
- packages.aerogramme = (rustRelease.workspace.aerogramme {}).bin;
+ packages.aerogramme = bin;
+ packages.container = container;
packages.default = self.packages.${targetHost}.aerogramme;
});
}