-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm.mod.nix
75 lines (58 loc) · 1.96 KB
/
vm.mod.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
# Intentionally not in `universal` because you should not be running my servers as a VM. They rely on physical properties.
personal.modules = [
({
lib,
config,
...
}: {
options = {
is-virtual-machine = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether the system is a virtual machine. Used to decide certain network and peripheral settings.";
};
};
config.virtualisation.vmVariant = {
is-virtual-machine = true;
services.openssh.enable = true;
services.openssh.settings.PermitEmptyPasswords = true;
users.users.sodiboo.hashedPassword = "";
security.sudo.wheelNeedsPassword = false;
services.qemuGuest.enable = true;
virtualisation.qemu.options = [
"-display sdl,gl=on"
"-device virtio-vga-gl"
];
environment.etc.issue.text = ''
Welcome to ${config.networking.hostName}! You're in a virtual machine.
---
Compositor binds are based on Alt, because
i expect your host OS to be using Super.
Also, surprise! You're using a Nordic layout.
I don't know a good way to change that for you.
---
The compositor may also fail to launch;
this is somewhat inconsistent.
Try `ssh`ing in and checking
`systemctl --user status niri`
if that happens.
The most common fix is to just reboot the VM.
Press F12 to do that.
---
The user is `sodiboo` and there is no password.
---
'';
virtualisation.memorySize = 4096;
virtualisation.cores = 4;
networking.wireguard.enable = lib.mkForce false;
services.tailscale.enable = lib.mkForce false;
};
})
];
sodium.modules = [
{
# virtualisation.vmVariant.services.openvpn.servers.sodium.autoStart = false;
}
];
}