From 24e276fdc86b8442379c845d50a35ec34363ac9d Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Mon, 27 Dec 2021 12:07:49 +0000 Subject: [PATCH] add qemu-user --- flake.nix | 1 + hosts/lappy/lappy.nix | 5 ++++- profiles/qemu_user/qemu_user.nix | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 profiles/qemu_user/qemu_user.nix diff --git a/flake.nix b/flake.nix index 1e82589..9159b92 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; deploy-rs.url = "github:serokell/deploy-rs"; + #mobile-nixos.url = "github:NixOS/mobile-nixos"; }; outputs = { ... }@inputs: import ./outputs.nix inputs; diff --git a/hosts/lappy/lappy.nix b/hosts/lappy/lappy.nix index bd26ecf..252d134 100644 --- a/hosts/lappy/lappy.nix +++ b/hosts/lappy/lappy.nix @@ -12,7 +12,10 @@ profiles.sway profiles.dnscrypt 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.sshd ]; diff --git a/profiles/qemu_user/qemu_user.nix b/profiles/qemu_user/qemu_user.nix new file mode 100644 index 0000000..bcb54df --- /dev/null +++ b/profiles/qemu_user/qemu_user.nix @@ -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} + ''; +}