add basic vm configuration

This commit is contained in:
Rouven Seifert 2023-05-01 12:30:21 +02:00
parent a9cfb32b12
commit 26e43a6da8
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
5 changed files with 111 additions and 6 deletions

48
hosts/vm/default.nix Normal file
View file

@ -0,0 +1,48 @@
{ config, pkgs, ... }:
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
kernelPackages = pkgs.linuxPackages_latest;
tmp.useTmpfs = true;
};
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "dvorak";
};
environment.systemPackages = with pkgs; [
vim
wget
htop-vim
];
programs.git = {
enable = true;
config = {
user.name = "Rouven Seifert";
user.email = "rouven@rfive.de";
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# firmware updates
users.users.root.openssh.authorizedKeys.keyFiles = [
../../keys/ssh/rouven-thinkpad
];
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,23 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
# Replace with actual config
device = "/dev/sda";
fsType = "ext4";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}