summaryrefslogtreecommitdiff
path: root/nix/dev/docker.nix
blob: b209015c138707d9fb0869ead4cefeb08f618c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{withSystem, ...}: {
  perSystem = {
    lib,
    pkgs,
    self',
    ...
  }: let
    containerFor = arch:
      pkgs.dockerTools.buildLayeredImage {
        name = "teawiebot";
        tag = "latest-${arch}";
        contents = [pkgs.dockerTools.caCertificates];
        config.Cmd = [
          (lib.getExe self'.packages."teawiebot-static-${arch}")
        ];

        architecture = withSystem "${arch}-linux" ({pkgs, ...}: pkgs.pkgsStatic.go.GOARCH);
      };
  in {
    packages = {
      container-x86_64 = containerFor "x86_64";
      container-aarch64 = containerFor "aarch64";
    };
  };
}