From 5ea22a5b00583843b3dbf3b1cc0c7a645578e376 Mon Sep 17 00:00:00 2001 From: volth Date: Sat, 10 Nov 2018 01:18:06 +0000 Subject: [PATCH] nixos/nix: ignore nix.checkConfig when cross-compiling (#48225) * nixos/nix: ignore nix.checkConfig when cross-compiling the check always fails because of architecture mismatch * typos --- nixos/modules/services/misc/nix-daemon.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 5e171c08d893..973575570612 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -62,11 +62,15 @@ let ''} $extraOptions END - '' + optionalString cfg.checkConfig '' - echo "Checking that Nix can read nix.conf..." - ln -s $out ./nix.conf - NIX_CONF_DIR=$PWD ${cfg.package}/bin/nix show-config >/dev/null - ''); + '' + optionalString cfg.checkConfig ( + if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then '' + echo "Ignore nix.checkConfig when cross-compiling" + '' else '' + echo "Checking that Nix can read nix.conf..." + ln -s $out ./nix.conf + NIX_CONF_DIR=$PWD ${cfg.package}/bin/nix show-config >/dev/null + '') + ); in