-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
169 lines (141 loc) · 4.94 KB
/
flake.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager }: {
nixosConfigurations.sysprog-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
({ pkgs, modulesPath, ... }: {
imports = [
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.developer = import ./home.nix;
}
(modulesPath + "/virtualisation/virtualbox-image.nix") {
virtualbox = {
params = {
cpus = "2";
graphicscontroller = "vmsvga";
vram = "128";
usb = "off";
usbehci = "off";
mouse = "ps2";
nic1 = "nat";
ostype = "Linux_64";
description = ''
Regular user
name: developer, password: developer
Root user
name: root, password: developer
'';
};
memorySize = 4096;
vmName = "sysprog 2021WT";
};
}];
# Let 'nixos-version --json' know about the Git revision
# of this flake.
# The qemu-vm module does this out of the box.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
virtualisation.virtualbox.guest.enable = true;
# add language features that enable flakes
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
time.timeZone = "Europe/Vienna";
system.autoUpgrade = {
enable = true;
flake = "github:mschwaig/sysprog-vm/main";
allowReboot = false;
dates = "*:0/10";
randomizedDelaySec = "1min";
};
# add system packages
environment.systemPackages = with pkgs; [
# terminal development tools
gcc10 clang_12 gnumake valgrind gdb binutils git manpages python38
# debugging in a browser
gdbgui
# terminal text editors vim and nano
(neovim.override { vimAlias = true; }) nano
# system load montitoring tool
htop
# graphics diagnosis tool
glxinfo
# archiving terminal utilities
zip unzip gnutar
# archiving gui
ark
# gui text editor
leafpad
# browser
firefox
# IDE
codeblocks
];
programs.vim.defaultEditor = true;
services.xserver = {
enable = true;
desktopManager.plasma5 = {
enable = true;
};
displayManager = {
autoLogin.enable = true;
autoLogin.user = "developer";
};
layout = "de,us";
libinput.enable = true; # for touchpad support on many laptops
};
# use same keyboard config as xserver
console.useXkbConfig = true;
# Enable sound in virtualbox appliances.
hardware.pulseaudio.enable = true;
boot.cleanTmpDir = true;
networking.hostName = "sysprog-vm";
networking.firewall.allowPing = true;
users.users.root = {
initialPassword = "developer";
};
users.users.developer = {
isNormalUser = true;
extraGroups = [ "wheel" "vboxsf" ];
description = "Developer";
initialPassword = "developer";
};
fonts.fontconfig.localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias binding="weak">
<family>monospace</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>sans-serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
<alias binding="weak">
<family>serif</family>
<prefer>
<family>emoji</family>
</prefer>
</alias>
</fontconfig>
'';
})
];
};
};
}