site/docker.nix

24 lines
557 B
Nix
Raw Normal View History

{ system ? builtins.currentSystem }:
let
2020-07-14 21:40:11 +00:00
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { inherit system; };
callPackage = pkgs.lib.callPackageWith pkgs;
site = callPackage ./site.nix { };
dockerImage = pkg:
pkgs.dockerTools.buildLayeredImage {
name = "xena/christinewebsite";
2020-07-14 21:14:01 +00:00
tag = "latest";
2020-07-14 21:40:11 +00:00
contents = [ pkg ];
config = {
2020-07-14 21:14:01 +00:00
Cmd = [ "${pkg}/bin/xesite" ];
2020-07-14 21:40:11 +00:00
Env = [ "CONFIG_FNAME=${pkg}/config.dhall" "RUST_LOG=info" ];
WorkingDir = "/";
};
};
in dockerImage site