This repository has been archived by the owner on Feb 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configuration.nix
287 lines (238 loc) · 6.51 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
{ config, pkgs, ... }:
let
user = "yusu";
in
{
nixpkgs.config.allowUnfree = true;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
nix = {
settings = {
substituters = [
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
};
system.stateVersion = "22.05"; # Did you read the comment?
boot.loader = {
timeout = 2;
# use UEFI
systemd-boot.enable = true;
efi.canTouchEfiVariables = false;
efi.efiSysMountPoint = "/boot/efi";
# use GRUB
# grub = {
# enable = true;
# version = 2;
# device = "/dev/sda";
# theme = pkgs.nixos-grub2-theme;
# # whether to have grub probe for other devices to boot from (e.g. windows)
# useOSProber = false;
# };
};
boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
boot.kernelModules = [
"kvm-intel"
# Virtual Camera
"v4l2loopback"
# Virtual Microphone, built-in
"snd-aloop"
];
# Make some extra kernel modules available to NixOS
boot.extraModulePackages = with config.boot.kernelPackages;
[ v4l2loopback.out ];
# Set initial kernel module settings
boot.extraModprobeConfig = ''
# exclusive_caps: Skype, Zoom, Teams etc. will only show device when actually streaming
# card_label: Name of virtual camera, how it'll show up in Skype, Zoom, Teams
# https://github.com/umlaeute/v4l2loopback
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
networking = {
hostName = "hephaestus"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networkmanager.enable = true;
# Open ports in the firewall.
firewall = {
enable = true;
allowedTCPPortRanges = [
# GS-/KDE-Connect
{ from = 1714; to = 1764; }
];
allowedUDPPortRanges = [
# GS-/KDE-Connect
{ from = 1714; to = 1764; }
];
};
};
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
services.mullvad-vpn.enable = true;
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Select internationalization properties.
i18n.defaultLocale = "en_US.utf8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.utf8";
LC_IDENTIFICATION = "de_DE.utf8";
LC_MEASUREMENT = "de_DE.utf8";
LC_MONETARY = "de_DE.utf8";
LC_NAME = "de_DE.utf8";
LC_NUMERIC = "en_US.utf8";
LC_PAPER = "de_DE.utf8";
LC_TELEPHONE = "de_DE.utf8";
LC_TIME = "de_DE.utf8";
};
services.xserver = {
# Use the X11 Display Server
enable = true;
# Enable Desktop Environments
desktopManager = {
gnome.enable = false;
plasma5.enable = true;
};
# Enable Window Managers
windowManager = {
qtile.enable = true;
};
# Set and configure login manager
displayManager = {
sddm = {
enable = true;
};
defaultSession = "none+qtile";
autoLogin = {
user = "${user}";
};
};
# Set the X11 keyboard layout.
# I use the international version of the US layout for my lily58.
layout = "us";
xkbVariant = "altgr-intl";
};
fonts.fonts = with pkgs; [
open-sans
ubuntu_font_family
(nerdfonts.override { fonts = [
"FiraCode"
"UbuntuMono"
]; })
];
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
nix.settings.auto-optimise-store = true;
system.autoUpgrade = {
enable = true;
flake = "/etc/nixos";
flags = [ "--update-input" "nixpkgs" ];
};
boot = {
tmpOnTmpfs = true;
tmpOnTmpfsSize = "75%";
};
fileSystems."/home" = {
label = "home";
fsType = "ext4";
options = [ "defaults" ];
};
fileSystems."/mnt/HDD" = {
label = "HDD";
fsType = "ntfs";
options = [ "defaults" "x-systemd.automount" "noauto" ];
};
fileSystems."/mnt/Media" = {
device = "192.168.178.74:/srv/nfs/Media";
fsType = "nfs";
options = [ "defaults" "x-systemd.automount" "noauto" "timeo=900" "retrans=5" "_netdev" ];
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.powerManagement.enable = true;
hardware.nvidia.modesetting.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = false; # Open ports in the firewall for Source Dedicated Server
};
programs.gamemode = {
enable = true;
};
services.syncthing = {
enable = true;
dataDir = "/home/${user}/.syncthing";
configDir = "/home/${user}/.config/syncthing";
user = "${user}";
group = "users";
overrideDevices = false; # overrides any devices added or deleted through the WebUI
overrideFolders = false; # overrides any folders added or deleted through the WebUI
devices = import ./.secrets/syncthing/devices.nix;
folders = import ./.secrets/syncthing/folders.nix;
};
services.udev.packages = [
pkgs.qmk-udev-rules
];
# Enable CUPS to print documents.
services.printing = {
enable = true;
};
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
environment.systemPackages = [
pkgs.vim
pkgs.wget
pkgs.git
pkgs.git-crypt
];
programs.fish.enable = true;
services.flatpak.enable = true;
xdg.portal = {
enable = true;
extraPortals = [ pkgs.libsForQt5.xdg-desktop-portal-kde ];
};
# virtualisation.docker.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
services.languagetool = {
enable = true;
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.${user} = {
isNormalUser = true;
description = "${user}";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.fish;
};
}