This repository was archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
250 lines (216 loc) · 5.56 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
{ config, pkgs-unstable, pkgs-stable, lib, home-manager, nix-flatpak, rose-pine-hyprcursor, ... }:
{
imports =
[
./hardware-configuration.nix
];
# NVIDIA driver settings
hardware.opengl = { enable = true; driSupport = true; driSupport32Bit = true; };
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = false;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# kernel
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
boot.kernelModules = [
"v4l2loopback"
];
boot.kernelPackages = pkgs-unstable.linuxPackages_zen;
# Networking + Bootloader
networking.hostName = "pika-nix";
networking.networkmanager.enable = true;
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
# Localisation Properties
time.timeZone = "Europe/London";
i18n.defaultLocale = "en_GB.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_GB.UTF-8";
LC_IDENTIFICATION = "en_GB.UTF-8";
LC_MEASUREMENT = "en_GB.UTF-8";
LC_MONETARY = "en_GB.UTF-8";
LC_NAME = "en_GB.UTF-8";
LC_NUMERIC = "en_GB.UTF-8";
LC_PAPER = "en_GB.UTF-8";
LC_TELEPHONE = "en_GB.UTF-8";
LC_TIME = "en_GB.UTF-8";
};
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Systemd Services
systemd.services.VPNService = {
description = "Runs VPN on boot";
wantedBy = ["multi-user.target"];
path = [pkgs-unstable.wireguard-tools pkgs-unstable.coreutils pkgs-unstable.openresolv];
after = [ "multi-user.target" ];
script = ''/home/pika/Software/pika-nixconfig/scripts/VPN/vpn_handler up'';
serviceConfig = {
User = "root";
Group = "root";
};
};
systemd.services.StartDefaultNetworkService = {
description = "Starts default VM network on boot";
wantedBy = ["multi-user.target"];
path = [pkgs-unstable.libvirt];
script = ''virsh net-list | grep -q "default" && echo "default network already started" || virsh net-start default'';
serviceConfig = {
User = "root";
Group = "root";
};
};
# Virtualisation Settings
programs.dconf.enable = true;
virtualisation = {
libvirtd = {
enable = true;
qemu = {
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [ pkgs-unstable.OVMFFull.fd ];
};
};
spiceUSBRedirection.enable = true;
};
services.spice-vdagentd.enable = true;
boot = {
initrd.kernelModules = [
"vfio_pci"
"vfio"
"vfio_iommu_type1"
"nvidia"
"nvidia_modeset"
"nvidia_uvm"
"nvidia_drm"
];
kernelParams = [
"amd_iommu=on"
"vfio-pci.ids=10de:13c0,10de:0fbb"
];
};
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 pika kvm -"
];
# Home manager setup
users.users.pika = {
isNormalUser = true;
description = "pika";
extraGroups = [ "networkmanager" "wheel" "libvirtd" "kvm"];
packages = with pkgs-unstable; [];
};
home-manager = {
extraSpecialArgs = { inherit rose-pine-hyprcursor; };
users = {
"pika" = import ./home.nix;
};
};
# NixOS settings
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Install Packages
environment.systemPackages =
# UNSTABLE PACKAGES
(with pkgs-unstable; [
# GENERAL APPs
killall
swww
fastfetch
dunst
slurp
grim
btop
obs-studio
rofi-wayland
rofi-power-menu
gnome.nautilus
vlc
vim
nvitop
librewolf
teams-for-linux
ventoy-full
gparted
git
hyprland
libsForQt5.koko
prismlauncher
rustup
vscodium-fhs
betterbird
lua
wireguard-tools
qbittorrent-qt5
libreoffice
kitty
(ollama.override { acceleration = "cuda"; })
vesktop
waybar
android-tools
signal-desktop
hyprpaper
freetube
satty
cura
prusa-slicer
telegram-desktop
# DEPENDENCIES
xdg-utils
wl-clipboard
# REQUIRED FOR VMs
virt-manager
spice spice-gtk
spice-protocol
win-virtio
win-spice
gnome.adwaita-icon-theme
virtiofsd
]) ++
# STABLE PACKAGES
(with pkgs-stable; [
looking-glass-client
]);
services.flatpak.packages = [
"com.github.xournalpp.xournalpp"
"com.rtosta.zapzap"
];
# Audio (pipewire) settings
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
wireplumber.enable = true;
};
fonts.packages = with pkgs-unstable; [
nerdfonts
];
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
# Enabling programs & services
programs.hyprland.enable = true;
programs.steam.enable = true;
services.openssh.enable = true;
services.flatpak.enable = true;
services.flatpak.uninstallUnmanaged = true;
services.devmon.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
hardware.opentabletdriver.enable = true;
hardware.opentabletdriver.daemon.enable = true;
# Default system version -- recommended to leave alone
system.stateVersion = "23.11";
}