add qemu-user

This commit is contained in:
ChaotiCryptidz 2021-12-27 12:07:49 +00:00
parent 5e1f7f5479
commit 24e276fdc8
3 changed files with 18 additions and 1 deletions

View file

@ -5,6 +5,7 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
#mobile-nixos.url = "github:NixOS/mobile-nixos";
}; };
outputs = { ... }@inputs: import ./outputs.nix inputs; outputs = { ... }@inputs: import ./outputs.nix inputs;

View file

@ -12,7 +12,10 @@
profiles.sway profiles.sway
profiles.dnscrypt profiles.dnscrypt
profiles.gaming profiles.gaming
# For sci-hub and whenever websites break # so i can build nixos mobile
profiles.qemu_user
# for sci-hub and whenever websites break
# profiles.tor # profiles.tor
# profiles.sshd # profiles.sshd
]; ];

View file

@ -0,0 +1,13 @@
{ config, pkgs, ... }: {
boot.binfmt.registrations.aarch64 = {
interpreter = "${pkgs.qemu}/bin/qemu-aarch64";
magicOrExtension =
"\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7\\x00";
mask =
"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xfe\\xff\\xff\\xff";
};
nix.sandboxPaths = [ "/run/binfmt" "${pkgs.qemu}" ];
nix.extraOptions = ''
extra-platforms = aarch64-linux ${pkgs.system}
'';
}