Build Docker image using nix

This commit is contained in:
Valentin Brandl 2020-03-20 17:47:41 +01:00
parent d39a81720a
commit 6c414bf07d
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -27,6 +27,25 @@ let
# packageOverrides
};
in
(rustPkgs.workspace.hoc {}).overrideAttrs (drv: {
rec {
inherit rustPkgs;
shell = pkgs.mkShell {
inputsFrom = pkgs.lib.mapAttrsToList (_: pkg: pkg { }) rustPkgs.noBuild.workspace;
nativeBuildInputs = with rustPkgs; [ cargo rustc ];
};
package = (rustPkgs.workspace.hoc {}).overrideAttrs (drv: {
buildInputs = drv.buildInputs or [ ] ++ [ pkgs.git ];
})
});
dockerImage =
pkgs.dockerTools.buildImage {
name = "vbrandl/hits-of-code";
tag = "1";
contents = [ package ];
config = {
Cmd = [ "/bin/hoc" ];
WorkingDir = "/";
};
};
}