make vm architecture agnostic
This commit is contained in:
parent
76eb3501b9
commit
b5562ef662
7 changed files with 103 additions and 88 deletions
40
hardware/vm-generic/default.nix
Normal file
40
hardware/vm-generic/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
imports = [];
|
||||
|
||||
boot.initrd.availableKernelModules = ["ehci_pci" "xhci_pci" "usbhid" "sr_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0077" "dmask=0077"];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-label/swap";}
|
||||
];
|
||||
|
||||
# Set platform from the system argument passed by the flake
|
||||
nixpkgs.hostPlatform = lib.mkDefault system;
|
||||
|
||||
# Enable Parallels tools only on aarch64
|
||||
hardware.parallels.enable = lib.mkIf (system == "aarch64-linux") true;
|
||||
nixpkgs.config.allowUnfreePredicate =
|
||||
lib.mkIf (system == "aarch64-linux")
|
||||
(pkg: builtins.elem (lib.getName pkg) ["prl-tools"]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue