Skip to content

Commit

Permalink
nixos/nix/cross-compiling: do not enable QEMU emulation if Tailscale …
Browse files Browse the repository at this point in the history
…is enabled
  • Loading branch information
thiagokokada committed Sep 23, 2023
1 parent 5f9fe7a commit 824a57e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/nix/cross-compiling.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ in
emulatedSystems = lib.mkOption {
description = "List of systems to emulate via QEMU";
type = lib.types.listOf lib.types.str;
default = [ "aarch64-linux" ];
default = lib.optionals (!config.nixos.desktop.tailscale.enable) [ "aarch64-linux" ];
};
};

config = lib.mkIf cfg.enable {
# Allow compilation of packages ARM/ARM64 architectures via QEMU
# e.g. nix-build -A <pkg> --argstr system aarch64-linux
# https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_QEMU
boot.binfmt = {
boot.binfmt = lib.mkIf (cfg.emulatedSystems != [ ]) {
inherit (cfg) emulatedSystems;
};

Expand Down

0 comments on commit 824a57e

Please sign in to comment.