From b37602a263cd1217835772bab38005b60779bfa0 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 1 May 2024 11:06:51 +0200 Subject: [PATCH] fix(nix): fix container architecture Signed-off-by: Sefa Eyeoglu --- flake.nix | 15 ++++++--------- nix/derivation.nix | 4 ++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 15211ef..18f5cda 100644 --- a/flake.nix +++ b/flake.nix @@ -83,15 +83,12 @@ rust-overlay = rust-overlay.packages.${system}; }; - mkContainerFor = refraction: let - architecture = refraction.stdenv.hostPlatform.ubootArch; - in - pkgs.dockerTools.buildLayeredImage { - name = "refraction"; - tag = "latest-${architecture}"; - config.Cmd = [(lib.getExe refraction)]; - inherit architecture; - }; + mkContainerFor = refraction: pkgs.dockerTools.buildLayeredImage { + name = "refraction"; + tag = "latest-${refraction.stdenv.hostPlatform.qemuArch}"; + config.Cmd = [(lib.getExe refraction)]; + inherit (refraction) architecture; + }; in { refraction = pkgs.callPackage ./nix/derivation.nix {inherit self;}; diff --git a/nix/derivation.nix b/nix/derivation.nix index 9d95a29..0e86a18 100644 --- a/nix/derivation.nix +++ b/nix/derivation.nix @@ -1,6 +1,7 @@ { lib, stdenv, + go, rustPlatform, darwin, self, @@ -53,6 +54,9 @@ rustPlatform.buildRustPackage { strip = "symbols"; }); + # useful for container images + passthru.architecture = go.GOARCH; + meta = with lib; { mainProgram = "refraction"; description = "Discord bot for Prism Launcher";