diff --git a/README.md b/README.md index f7d9595..e2945a0 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,9 @@ Deploy refreshed secrets. ```shell $ nixos-rebuild switch --flake . --target-host 192.168.1.195 --fast --use-remote-sudo ``` + +VM install + +``` +$ nixos-install --flake github:esselius/cfg#vm +``` diff --git a/nixos-configurations/vm.nix b/nixos-configurations/vm.nix index b85c3dd..c97cef3 100644 --- a/nixos-configurations/vm.nix +++ b/nixos-configurations/vm.nix @@ -1,3 +1,5 @@ +{ modulesPath, ezModules, ... }: + { nixpkgs.hostPlatform = "aarch64-linux"; @@ -5,4 +7,10 @@ context = "work"; formfactor = "vm"; + + imports = [ + "${modulesPath}/virtualisation/vmware-guest.nix" + ezModules.hardware-vm + ezModules.user-peteresselius + ]; } diff --git a/nixos-modules/hardware-vm.nix b/nixos-modules/hardware-vm.nix new file mode 100644 index 0000000..80accff --- /dev/null +++ b/nixos-modules/hardware-vm.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "uhci_hcd" "ahci" "xhci_pci" "nvme" "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"; + }; + + swapDevices = [ ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +}