patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Yuri Nesterov <yuriy.nesterov@unikie.com>
To: devel@spectrum-os.org
Cc: Yuri Nesterov <yuriy.nesterov@unikie.com>
Subject: [PATCH] img/live: use callPackage function instead of "with pkgs;"
Date: Tue, 27 Sep 2022 15:33:18 +0300	[thread overview]
Message-ID: <20220927123318.2531867-1-yuriy.nesterov@unikie.com> (raw)

When cross compiling Spectrum OS for aarch64 it tries to run aarch64
binaries on x64 host. To fix this issue it is possible to add
pkgsBuildHost prefix to all native build inputs. However, a better
option would probably be to use callPackage function. With that change
it is able to automatically select correct packages.

Signed-off-by: Yuri Nesterov <yuriy.nesterov@unikie.com>
---
 img/live/default.nix | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/img/live/default.nix b/img/live/default.nix
index 5461384..1fa8da3 100644
--- a/img/live/default.nix
+++ b/img/live/default.nix
@@ -1,7 +1,11 @@
 # SPDX-License-Identifier: MIT
 # SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2022 Unikie
 
-{ config ? import ../../nix/eval-config.nix {} }:
+{ config ? import ../../nix/eval-config.nix {} }: config.pkgs.callPackage (
+
+{ stdenvNoCC, cryptsetup, dosfstools, jq, mtools, util-linux, stdenv
+, systemd }:
 
 let
   inherit (config) pkgs;
@@ -15,8 +19,6 @@ let
   initramfs = import ../../host/initramfs { inherit config rootfs; };
 in
 
-with pkgs;
-
 stdenvNoCC.mkDerivation {
   name = "spectrum-live.img";
 
@@ -48,3 +50,4 @@ stdenvNoCC.mkDerivation {
 
   passthru = { inherit rootfs; };
 }
+) {}
-- 
2.34.1



             reply	other threads:[~2022-09-27 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 12:33 Yuri Nesterov [this message]
2022-09-27 13:48 ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220927123318.2531867-1-yuriy.nesterov@unikie.com \
    --to=yuriy.nesterov@unikie.com \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).