patches and low-level development discussion
 help / color / mirror / code / Atom feed
* [PATCH] img/live: use callPackage function instead of "with pkgs;"
@ 2022-09-27 12:33 Yuri Nesterov
  2022-09-27 13:48 ` Alyssa Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Yuri Nesterov @ 2022-09-27 12:33 UTC (permalink / raw)
  To: devel; +Cc: Yuri Nesterov

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] img/live: use callPackage function instead of "with pkgs;"
  2022-09-27 12:33 [PATCH] img/live: use callPackage function instead of "with pkgs;" Yuri Nesterov
@ 2022-09-27 13:48 ` Alyssa Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Alyssa Ross @ 2022-09-27 13:48 UTC (permalink / raw)
  To: Yuri Nesterov, devel; +Cc: Yuri Nesterov

This patch has been committed as 1886a354da6a5553381d604dda41c24deb0fba0f,
which can be viewed online at
https://spectrum-os.org/git/spectrum/commit/?id=1886a354da6a5553381d604dda41c24deb0fba0f.

This is an automated message.  Send comments/questions/requests to:
Alyssa Ross <hi@alyssa.is>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-27 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 12:33 [PATCH] img/live: use callPackage function instead of "with pkgs;" Yuri Nesterov
2022-09-27 13:48 ` Alyssa Ross

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).