{ lib, machineInfo, ... }: { imports = [ ./modules/custom-build-vm.nix ./modules/custom-sops-nix.nix ./modules/my-users.nix ./modules/sddm.nix ./modules/unfree.nix ]; config = { system.stateVersion = "23.11"; # Map host keys into VM and launch vm using `virt-viewer` virtualisation = let vmConfig = { virtualisation = { sharedHostKeys = true; sharedUserKeys = true; usb-redirect = true; virt-viewer = true; cores = 4; memorySize = 4 * 1024; }; }; in { vmVariant = vmConfig; vmVariantWithBootLoader = vmConfig; }; users.myUsers = machineInfo.config.users; home-manager = { useUserPackages = true; useGlobalPkgs = true; users = lib.attrsets.concatMapAttrs (username: user: let hostname = machineInfo.name; getUserConfig = import ./utils/user-config.nix { inherit lib; }; configPath = getUserConfig { inherit hostname username; }; in if (configPath != null) then { ${username} = { pkgs, ... }@args: import configPath ({ userConfig = { inherit hostname username; } // user; } // args); } else {}) machineInfo.config.users; }; # Networking networking.hostName = machineInfo.name; # Set time zone time.timeZone = machineInfo.config.timeZone; # Configure keyboard layout console.keyMap = machineInfo.config.keyMap; services.xserver.xkb.layout = machineInfo.config.keyboardLayout; i18n.extraLocaleSettings = machineInfo.config.localeSettings; }; }