-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvmconfig.nix
50 lines (42 loc) · 913 Bytes
/
vmconfig.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
config,
pkgs,
lib,
...
}:
{
# Basic system settings
system.stateVersion = "23.11";
# VM-specific settings
virtualisation = {
diskSize = lib.mkForce 4096; # Force our disk size setting
memorySize = 2048; # RAM in MiB (2GB)
};
# Enable SSH
services.openssh.enable = true;
# Create a root user with password "nixos"
users.users.root.initialPassword = "nixos";
# Create a regular user
users.users.demo = {
isNormalUser = true;
initialPassword = "demo";
extraGroups = [ "wheel" ]; # Enable sudo
};
# Basic packages
environment.systemPackages = with pkgs; [
vim
git
htop
];
# Enable networking
networking = {
hostName = "nixos-vm";
networkmanager.enable = true;
};
# Enable basic system services
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
}