blob: 514b307dc74137c8a9d55c67e68d5bd7a6b449d8 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
{
inputs,
flake-parts-lib,
withSystem,
...
}: {
flake.nixosModules.default = flake-parts-lib.importApply ./module.nix {
inherit withSystem;
};
perSystem = {
lib,
pkgs,
system,
config,
inputs',
self',
...
}: let
crossPkgs = with pkgs.pkgsCross; {
x86_64 = musl64;
aarch64 = aarch64-multiplatform.pkgsStatic;
};
teawieFor = arch:
pkgs.callPackage ./static.nix {
inherit (self'.packages) teawiebot;
pkgsStatic = crossPkgs.${arch};
fenix = inputs'.fenix.packages;
naersk = inputs.naersk.lib.${system};
};
containerFor = arch:
pkgs.dockerTools.buildLayeredImage {
name = "teawiebot";
tag = "latest-${arch}";
contents = [pkgs.dockerTools.caCertificates];
config.Cmd = [
(lib.getExe self'.packages."teawiebot-static-${arch}")
];
architecture = crossPkgs.${arch}.go.GOARCH;
};
in {
packages = {
teawiebot-static-x86_64 = teawieFor "x86_64";
teawiebot-static-aarch64 = teawieFor "aarch64";
container-x86_64 = containerFor "x86_64";
container-aarch64 = containerFor "aarch64";
};
};
}
|