forked from arcnmx/home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cross.nix
31 lines (29 loc) · 873 Bytes
/
cross.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ pkgs, config, lib, ... }: with lib; {
options = {
home.profileSettings.cross = {
aarch64 = mkOption {
type = types.bool;
default = true;
};
armv7l = mkOption {
type = types.bool;
default = false;
};
};
};
config = {
boot.binfmt = {
emulatedSystems = mkIf config.home.profileSettings.cross.aarch64 [ "aarch64-linux" ];
registrations.aarch64-linux = let
qemu = pkgs.qemu-vfio or pkgs.qemu;
in mkIf config.home.profileSettings.cross.aarch64 {
interpreter = "${qemu}/bin/qemu-aarch64";
wrapInterpreterInShell = false;
};
};
nix = mkIf config.home.profileSettings.cross.armv7l {
binaryCaches = [ "https://arm.cachix.org/" ];
binaryCachePublicKeys = [ "arm.cachix.org-1:5BZ2kjoL1q6nWhlnrbAl+G7ThY7+HaBRD9PZzqZkbnM=" ];
};
};
}