From 8527ad719d5cb02a723ae2535a51bd2de8993de4 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sat, 15 Jun 2024 11:35:50 -0400 Subject: [PATCH] phone: Add virtual machine support for x86_64-linux This makes it possible to test the phone config in a virtual machine on x86_64 machines. --- phone/flake.nix | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/phone/flake.nix b/phone/flake.nix index da8d35a4..aff9955a 100644 --- a/phone/flake.nix +++ b/phone/flake.nix @@ -10,11 +10,19 @@ outputs = { self, nixpkgs, mobile-nixos } @ attrs: { - nixosConfigurations = { + nixosConfigurations = + let + modules = [ + ./configuration.nix + ./hardware-configuration.nix + ]; + in + { mobile-nixos = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; specialArgs = attrs; - modules = [ + + modules = modules ++ [ (import "${mobile-nixos}/lib/configuration.nix" { device = "pine64-pinephone"; }) @@ -25,11 +33,15 @@ splash = nixpkgs.lib.mkDefault true; }; } - - ./configuration.nix - ./hardware-configuration.nix ]; }; + + mobile-nixos-vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = attrs; + + inherit modules; + }; }; }; }