-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
205 lines (183 loc) · 4.54 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
{
inputs,
pkgs,
config,
...
}: {
imports = [
inputs.home-manager.nixosModules.home-manager
];
home-manager = {
extraSpecialArgs = {inherit inputs;};
users.stephen = {...}: {
imports = [
./home
];
};
};
boot = {
# BBR is a more improved congestion control method
kernelModules = ["tcp_bbr"];
kernel = {
sysctl = {
"net.ipv4.tcp_congestion_control" = "bbr";
# Increase TCP window sizes for high bandwidth WAN connections
# Assumes 10 GBit/s over 200ms latency worst case
"net.core.wmem_max" = 1073741824; # 1 GiB
"net.core.rmem_max" = 1073741824; # 1 GiB
"net.ipv4.tcp_rmem" = "4096 87380 1073741824"; # 1 GiB max
"net.ipv4.tcp_wmem" = "4096 87380 1073741824";
};
}; # 1 GiB max
# Use the grub EFI boot loader.
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
};
};
};
swapDevices = [
{
device = "/swapfile";
size = 16 * 1024;
}
];
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
networking.firewall.enable = false;
time.timeZone = "Europe/Dublin";
i18n.defaultLocale = "en_IE.UTF-8";
services = {
greetd = {
enable = true;
settings = {
default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --remember --remember-user-session --user-menu --asterisks --sessions ${config.services.displayManager.sessionData.desktops}/share/wayland-sessions --xsessions ${config.services.displayManager.sessionData.desktops}/share/xsessions";
user = "greeter";
};
};
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
X11Forwarding = true;
};
};
flatpak.enable = true;
blueman.enable = true;
fprintd.enable = false;
upower.enable = true;
power-profiles-daemon.enable = true;
guix.enable = true;
};
systemd.services.greetd.serviceConfig = {
Type = "idle";
StandardInput = "tty";
StandardOutput = "tty";
StandardError = "journal"; # Without this errors will spam on screen
# Without these bootlogs will spam on screen
TTYReset = true;
TTYVHangup = true;
TTYVTDisallocate = true;
};
users.users.stephen = {
isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "video" "audio" "lp" "scanner" "libvirtd"];
initialPassword = "password";
shell = pkgs.zsh;
};
environment.systemPackages = with pkgs; [
neovim
wget
btop
ncdu
fzf
zathura
pulsemixer
google-chrome
mangohud
protonup
zulu
spotify-player
];
environment.sessionVariables = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
};
programs = {
hyprland = {enable = true;};
dconf = {enable = true;};
direnv = {enable = true;};
firefox = {enable = true;};
git = {
enable = true;
lfs.enable = true;
};
zsh = {enable = true;};
steam = {
enable = true;
gamescopeSession = {enable = true;};
};
gamemode = {enable = true;};
};
xdg.portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
xdgOpenUsePortal = true;
};
fonts.packages = with pkgs; [
liberation_ttf_v1
helvetica-neue-lt-std
nerd-fonts.jetbrains-mono
nerd-fonts.fira-code
];
security = {
sudo.wheelNeedsPassword = false;
doas.wheelNeedsPassword = false;
polkit.enable = true;
pam = {
services.swaylock = {};
};
};
system.stateVersion = "22.11"; # Did you read the comment?
nix = {
gc = {
dates = "weekly";
automatic = true;
options = "--delete-older-than 7d";
};
optimise = {
dates = ["weekly"];
automatic = true;
};
channel = {
enable = false;
};
settings = {
sandbox = true;
max-jobs = "auto";
auto-optimise-store = true;
};
daemonIOSchedClass = "idle";
daemonCPUSchedPolicy = "idle";
extraOptions = "experimental-features = nix-command flakes";
registry.nixpkgs.flake = inputs.nixpkgs;
};
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;
}