feat(backend): janky (broken) cross compile/build setup using nix

This commit is contained in:
Ashhhleyyy 2024-02-18 13:22:54 +00:00
parent 4b8bb59bf3
commit f2bfefca39
Signed by: ash
GPG key ID: 83B789081A0878FB

View file

@ -39,6 +39,32 @@
WorkingDir = "/state";
};
};
cross = flake-utils.lib.eachDefaultSystem (crossSystem:
let
pkgs = import nixpkgs {
localSystem = system;
inherit crossSystem;
};
in
{
default = pkgs.python311Packages.buildPythonApplication {
pname = "aci-backend";
inherit version;
propagatedBuildInputs = dependencies pkgs.python311Packages;
src = ./backend;
};
docker = pkgs.dockerTools.buildLayeredImage {
name = self.packages.${system}.cross.default.${crossSystem}.pname;
tag = "latest";
contents = [ self.packages.${system}.cross.default.${crossSystem} pkgs.busybox ];
config = {
Cmd = [ "/bin/app.py" ];
WorkingDir = "/state";
};
};
});
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [