-
Notifications
You must be signed in to change notification settings - Fork 0
/
local-configuration.nix
230 lines (194 loc) · 4.56 KB
/
local-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
{ config, pkgs, ... }:
let
kernel = pkgs.linuxPackages_latest;
in
{
imports = [
./users/kraust.nix
./software/nvidia.nix
./software/stylix.nix
];
# Use rt kernel.
boot.kernelPackages = kernel;
# Set Hostname
networking.hostName = "tiny-stars";
# Enable networking
networking.networkmanager.enable = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.extraModulePackages = with config.boot.kernelPackages; [
];
boot.initrd.kernelModules = [
"msr"
"vfio"
"vfio_iommu_type1"
"vfio_pci"
];
# Blacklist watchdog.
boot.blacklistedKernelModules = [
];
# options vfio-pci ids=1002:164e,1002:1640
boot.extraModprobeConfig = ''
options vfio-pci ids=1002:67df,1002:aaf0
'';
boot.kernelParams = [
"amd_iommu=on"
"nvidia_drm.fbdev=1"
];
boot.tmp.useTmpfs = true;
# OpenGL Config
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
# Xbox One Controller
hardware.xone.enable = true;
# Tablet
hardware.opentabletdriver.enable = true;
# Scanner
# hardware.sane.enable = true;
# hardware.sane.extraBackends = [ pkgs.epkowa ];
# Needed by scanner?
# services.avahi.enable = true;
# services.avahi.nssmdns64 = true;
# Printing
# services.printing.enable = true;
# services.avahi = {
# enable = true;
# nssmdns = true;
# openFirewall = true;
# };
# GIMP support
# ln -s /run/current-system/sw/bin/xsane ~/.config/GIMP/2.10/plug-ins/xsane
nixpkgs.config.packageOverrides = pkgs: {
xsaneGimp = pkgs.xsane.override { gimpSupport = true; };
};
# Docker
virtualisation.docker = {
enable = true;
# enableNvidia = true;
};
# OOM KIller
services.earlyoom = {
enable = true;
freeSwapThreshold = 2;
freeMemThreshold = 2;
};
# Testing
networking.firewall = {
enable = true;
allowedTCPPorts = [
8083
];
allowedUDPPortRanges = [
];
};
# Set the user up
users.users.kraust = {
isNormalUser = true;
description = "Kraust";
extraGroups = [ "networkmanager" "wheel" "docker" "wireshark" "tcpdump" "scanner" "lp" "gamemode" "libvirtd" ];
shell = pkgs.fish;
};
programs.fish.enable = true;
environment.sessionVariables = {
STEAM_FORCE_DESKTOPUI_SCALING = "1";
GDK_SCALE = "1";
MUFFIN_NO_SHADOWS = "1";
NIXOS_OZONE_WL = "1";
};
programs.wireshark.enable = true;
catppuccin.enable = true;
catppuccin.flavor = "mocha";
programs.gamemode.enable = true;
programs.gamemode.settings.general.inhibit_screensaver = 0;
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
ovmf = {
enable = true;
packages = [
(pkgs.OVMF.override {
secureBoot = true;
tpmSupport = true;
}).fd
];
};
};
};
programs.virt-manager.enable = true;
# Possibly fixes Network Manager + 5GHz issues?
networking.networkmanager = {
wifi = {
scanRandMacAddress = false;
powersave = false;
};
};
services.dbus.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-wlr
pkgs.xdg-desktop-portal-gtk
];
};
programs.dconf.enable = true;
security.polkit.enable = true;
security.pam.loginLimits = [
{
domain = "@users";
item = "rtprio";
type = "-";
value = 1;
}
];
services.gvfs = {
enable = true;
};
powerManagement.cpuFreqGovernor = "powersave";
virtualisation.spiceUSBRedirection.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
lm_sensors
linuxPackages.turbostat
gparted
];
# Enable Desktop
services.desktopManager = {
cosmic.enable = true;
};
services.displayManager = {
autoLogin = {
enable = true;
user = "kraust";
};
cosmic-greeter.enable = true;
};
services.samba = {
enable = true;
openFirewall = true;
securityType = "auto";
extraConfig = ''
server min protocol = SMB2
lanman auth = yes
ntlm auth = yes
workgroup = WORKGROUP
usershare allow guests = yes
map to guest = bad user
'';
shares = {
samba = {
path = "/home/samba";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0777";
"directory mask" = "0777";
};
};
};
}