diff options
| author | seth <[email protected]> | 2024-03-20 08:12:19 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2024-03-20 08:12:19 -0400 |
| commit | d48ab1b30a4b6c093c2d7ff27dfb0b6d7a2bafdd (patch) | |
| tree | 0ab828f6c6738ec495aafbdf29c46c3cc3a5cbfe /nix/deployment/default.nix | |
| parent | 0f280dd61c1c138e4c41b715e27fc292f24bbac9 (diff) | |
nix: naersk -> rustPlatform
Diffstat (limited to 'nix/deployment/default.nix')
| -rw-r--r-- | nix/deployment/default.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/nix/deployment/default.nix b/nix/deployment/default.nix new file mode 100644 index 0000000..7fd379f --- /dev/null +++ b/nix/deployment/default.nix @@ -0,0 +1,35 @@ +{ + flake-parts-lib, + withSystem, + ... +}: { + imports = [./static.nix]; + + flake.nixosModules.default = flake-parts-lib.importApply ./module.nix { + inherit 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"; + }; + }; +} |
