-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
391 lines (333 loc) · 10.8 KB
/
configuration.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ pkgs, inputs, ... }:
let
kubeMasterIP = "192.168.1.2";
kubeMasterHostname = "a7.k8s.local";
# kubeMasterAPIServerPort = 6443;
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.initrd.kernelModules = [ "amdgpu" "coretemp" ];
boot.initrd.systemd.enable = true;
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "uas" "usbhid" "sd_mod" ];
boot.supportedFilesystems = [ "ntfs" "btrfs" "ext4" ];
boot.kernelModules = [ "kvm-amd" "bfq" "mt7921e" ];
boot.extraModulePackages = [ ];
hardware.firmware = with pkgs; [ linux-firmware ];
hardware.bluetooth.enable = true;
hardware.usb-modeswitch.enable = true;
hardware.graphics.enable = true;
networking.networkmanager.enable = true;
networking.hostName = "a7"; # Define your hostname.
networking.extraHosts =
''
${kubeMasterIP} ${kubeMasterHostname}
136.243.168.226 download.qt.io
'';
networking = {
bridges.br0.interfaces = [ "enp14s0" ];
useDHCP = false;
interfaces.enp14s0.useDHCP = false;
interfaces.br0.useDHCP = true;
};
time.timeZone = "Europe/Moscow";
i18n.extraLocaleSettings = {
LC_ADDRESS = "ru_RU.UTF-8";
LC_IDENTIFICATION = "ru_RU.UTF-8";
LC_MEASUREMENT = "ru_RU.UTF-8";
LC_MONETARY = "ru_RU.UTF-8";
LC_NAME = "ru_RU.UTF-8";
LC_NUMERIC = "ru_RU.UTF-8";
LC_PAPER = "ru_RU.UTF-8";
LC_TELEPHONE = "ru_RU.UTF-8";
LC_TIME = "ru_RU.UTF-8";
};
i18n = {
defaultLocale = "ru_RU.UTF-8";
supportedLocales = [ "ru_RU.UTF-8/UTF-8" ];
};
console = {
packages = with pkgs; [ terminus_font ];
font = "ter-v32n";
keyMap = "ru";
earlySetup = true;
};
services.xserver.enable = true;
services.xserver.xkb.layout = "us,ru";
services.xserver.xkb.options = "grp:win_space_toggle";
services.xserver.videoDrivers = [ "amdgpu" ];
services.xserver.desktopManager.plasma5.enable = true;
services.displayManager.sddm.enable = true;
services.displayManager.sddm.wayland.enable = false;
services.displayManager.sddm.settings.General.DisplayServer = "x11-user";
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "spiage";
services.xrdp.enable = true;
services.xrdp.defaultWindowManager = "startplasma-x11";
services.xrdp.openFirewall = true;
services.dbus.packages = [ pkgs.libsForQt5.kpmcore ];
services.libinput.enable = true;
services.fwupd.enable = true;
fonts.fontDir.enable = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
nerdfonts
terminus_font
terminus_font_ttf
terminus-nerdfont
];
#scanner
hardware.sane.enable = true;
hardware.sane.extraBackends = [ pkgs.sane-airscan ];
services.avahi.enable = true;
services.avahi.nssmdns4 = true;
###
services.printing.enable = true;
# sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
};
virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.onShutdown = "shutdown";
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
virtualisation.libvirtd.qemu.ovmf.packages = [
(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd
];
virtualisation.libvirtd.allowedBridges = [ "virbr0" "br0" ];
virtualisation = {
podman = {
enable = true;
dockerCompat = false;
dockerSocket.enable = false;
defaultNetwork.settings.dns_enabled = true;
# declare containers
};
oci-containers = {
## use podman as default container engine
backend = "podman";
};
};
virtualisation.docker.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.spiage = {
isNormalUser = true;
description = "spiage";
extraGroups = [ "networkmanager" "wheel" "scanner" "lp" "audio" "incus-admin" "kvm" "libvirtd" "vboxusers" "video" "docker" ];
};
nixpkgs.config.allowUnfree = true;
programs.kdeconnect.enable = true;
programs.traceroute.enable = true;
programs.tmux.enable = true;
programs.zsh.enable = true;
programs.starship.enable = true;
programs.starship.presets = [ "nerd-font-symbols" ];
services.rpcbind.enable = true; # needed for NFS
systemd.mounts = let commonMountOptions = {
type = "nfs";
mountConfig = {
Options = "noatime";
};
}; in [
(commonMountOptions // {
what = "j4:/vpool";
where = "/mnt/nfs";
})
];
systemd.automounts = let commonAutoMountOptions = {
wantedBy = [ "multi-user.target" ];
automountConfig = {
TimeoutIdleSec = "600";
};
}; in [
(commonAutoMountOptions // { where = "/mnt/nfs"; })
];
virtualisation.docker.extraOptions =
''--iptables=false --ip-masq=false -b br0'';
networking.firewall.allowedTCPPorts = [
2049 #NFSv4
49152 #libvirt live migration direct connect
6443 # k3s: required so that pods can reach the API server (running on port 6443 by default)
2379 # k3s, etcd clients: required if using a "High Availability Embedded etcd" configuration
2380 # k3s, etcd peers: required if using a "High Availability Embedded etcd" configuration
8080
3000
9100 # found input from a7
10250 # found input from i9
];
networking.firewall.allowedUDPPorts = [
8472 # k3s, flannel: required if using multi-node for inter-node networking
];
services.k3s = {
enable = true;
role = "server";
token = "Ee1ySKGVulT61yhl2hRDgXVP33OC8R0P"; #tr -dc A-Za-z0-9 </dev/urandom | head -c 32; echo
clusterInit = true;
extraFlags = "--write-kubeconfig-mode=644";
};
services.openssh.enable = true;
environment.systemPackages = with pkgs; [
# dbeaver-bin # Free multi-platform database tool for developers, SQL programmers, database administrators and analysts. Supports all popular databases: MySQL, PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access, Teradata, Firebird, Derby, etc.
inputs.last-working-dbeaver-bin.legacyPackages.x86_64-linux.pkgs.dbeaver-bin
inputs.yandex-browser.packages.x86_64-linux.yandex-browser-stable
# yandex-browser
thunderbird
birdtray
firefox
ansible # Radically simple IT automation
docker-compose # Docker CLI plugin to define and run multi-container applications with Docker
filezilla # Graphical FTP, FTPS and SFTP client
zoom-us # zoom.us video conferencing application
delve # debugger for the Go programming language
gdlv # GUI frontend for Delve
go # The Go Programming language
## go env -w GO111MODULE=off (for pass error in VSCode while Ctrl+F5)
alacritty # A cross-platform, GPU-accelerated terminal emulator
kitty # A modern, hackable, featureful, OpenGL based terminal emulator
wezterm # GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
#openlens # Kubernetes IDE
k9s # Kubernetes IDE for console
kompose
kubectl
kubernetes
kubernetes-helm
kubernetes-metrics-server
bridge-utils
wget
inetutils
micro
helix
st
libreoffice-qt
vmware-horizon-client
microsoft-edge
google-chrome
telegram-desktop
mc
oh-my-git
git
vscode
vscode-extensions.ms-toolsai.jupyter
vscode-extensions.bbenoist.nix
vscode-extensions.github.copilot
vscode-extensions.ms-python.python
vscode-extensions.hookyqr.beautify
vscode-extensions.ms-vscode.cpptools
vscode-extensions.jnoortheen.nix-ide
vscode-extensions.ms-dotnettools.csharp
vscode-extensions.kubukoz.nickel-syntax
vscode-extensions.yzhang.markdown-all-in-one
vscode-extensions.github.github-vscode-theme
vscode-extensions.brettm12345.nixfmt-vscode
vscode-extensions.b4dm4n.vscode-nixpkgs-fmt
vscode-extensions.mads-hartmann.bash-ide-vscode
vscode-extensions.davidanson.vscode-markdownlint
vscode-extensions.ms-vscode-remote.remote-ssh
vscode-extensions.foam.foam-vscode
vscode-extensions.bierner.markdown-mermaid
vscode-extensions.bierner.docs-view
vscode-extensions.bierner.emojisense
vscode-extensions.bierner.markdown-checkbox
vscode-extensions.bierner.markdown-emoji
vscode-extensions.shd101wyy.markdown-preview-enhanced
vscode-extensions.tomoki1207.pdf
vscode-extensions.alefragnani.bookmarks
vscode-extensions.alefragnani.project-manager
vscode-extensions.jebbs.plantuml
vscode-extensions.gruntfuggly.todo-tree
nixd
nil
jq
partition-manager # inputs.kde2nix.packages.x86_64-linux.partitionmanager
plasma-workspace-wallpapers #libsForQt5.plasma-workspace-wallpapers #collision with konsole from plasma 5 inputs.kde2nix.packages.x86_64-linux.plasma-workspace-wallpapers
pavucontrol # libsForQt5.kmix deprecated #marked broken inputs.kde2nix.packages.x86_64-linux.kmix
libsForQt5.kcmutils # inputs.kde2nix.packages.x86_64-linux.kcmutils
remmina # libsForQt5.krdc !vvv remmina is faster vvv!
skanpage
ktorrent
mpv dragon
kcalc
skanpage
#kmines
#libsForQt5.kpat # inputs.kde2nix.packages.x86_64-linux.kpat
#discover #fail with plasma 6.0.4
apt
dpkg
debootstrap
lm_sensors
lsof
ffmpeg #(pkgs.ffmpeg.override { withOptimisations = true; withFullDeps = true; })
# neofetch
fastfetch
btop
htop
#python311
(python3.withPackages(ps: with ps; [ notebook jupyter ])) #!!! waiting for https://github.com/NixOS/nixpkgs/pull/285959
gcc
clang
llvm
dash
sqlite
postgresql
nix-tree xsel #xclip #pbcopy wl-copy xsel (for 'Y to copy path')
nvd
qdirstat
p7zip
rar
fwupd
nvme-cli
hw-probe
inxi
dmidecode
clinfo
glxinfo
vulkan-tools
gpu-viewer
pciutils
zenstates
flare
wesnoth
qemu_kvm
virt-manager
podman-tui
podman-compose
wgetpaste
# zed-editor
anilibria-winmaclinux
ventoy-full
nut
libsForQt5.libksysguard
lm_sensors
rclone
masterpdfeditor
masterpdfeditor4
terminator
helvum
qpwgraph
];
system.stateVersion = "23.05"; # Did you read the comment?
}