From d48ab1b30a4b6c093c2d7ff27dfb0b6d7a2bafdd Mon Sep 17 00:00:00 2001 From: seth Date: Wed, 20 Mar 2024 08:12:19 -0400 Subject: nix: naersk -> rustPlatform --- nix/deployment/default.nix | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 nix/deployment/default.nix (limited to 'nix/deployment/default.nix') 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"; + }; + }; +} -- cgit v1.2.3