Add nix files
* Build file * Docker file
This commit is contained in:
parent
8ea16624ad
commit
418a2944f7
2 changed files with 25 additions and 0 deletions
10
build.nix
Normal file
10
build.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
let
|
||||
rustPlatform = pkgs.rustPlatform;
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "shifty-service";
|
||||
version = "0.1";
|
||||
src = ./.;
|
||||
cargoHash = "sha256-bgtX30TGRlBjCZ8qbqNgovsZrZqJ9kEGlv/qv6T5uZA=";
|
||||
}
|
||||
15
docker.nix
Normal file
15
docker.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
let
|
||||
shiftyService = import ./build.nix { inherit pkgs; };
|
||||
in pkgs.dockerTools.buildImage {
|
||||
name = "shifty-backend";
|
||||
tag = "0.1";
|
||||
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "terminal-tools";
|
||||
paths = [ pkgs.bash pkgs.coreutils pkgs.nix ];
|
||||
};
|
||||
config = {
|
||||
Cmd = [ "${shiftyService}/bin/app" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue