add docker image to flake

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-02-27 13:32:04 +00:00
parent c956022422
commit b92f7d216d
1 changed files with 18 additions and 1 deletions

View File

@ -9,7 +9,10 @@
outputs = { self, nixpkgs, flake-utils, naersk, xess, portable-svc }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (system:
let
pkgs = import nixpkgs { overlays = [ portable-svc.overlay ]; inherit system; };
pkgs = import nixpkgs {
overlays = [ portable-svc.overlay ];
inherit system;
};
naersk-lib = naersk.lib."${system}";
src = ./.;
in rec {
@ -34,6 +37,20 @@
}/static/css/xess.css $out/static/gruvbox.css
'';
};
docker = let
printerfacts = self.packages.${system}.printerfacts;
name = "xena/printerfacts";
tag = printerfacts.version;
in pkgs.dockerTools.buildLayeredImage {
inherit name tag;
contents = [ printerfacts ];
config = {
Cmd = [ "${printerfacts}/bin/printerfacts" ];
Env = [ "RUST_LOG=info" "PORT=32042" ];
WorkingDir = "/";
};
};
printerfacts-service = pkgs.substituteAll {
name = "printerfacts.service";
src = ./systemd/printerfacts.service.in;