-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.nix
359 lines (301 loc) · 9.46 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
# 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’).
{
config,
pkgs,
inputs,
lib,
...
}:
{
options.local.isDesktop = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = {
programs.partition-manager.enable = true;
nix.settings.system-features = [
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
"gccarch-znver4"
"gccarch-x86-64-v2"
"gccarch-x86-64-v3"
];
nixpkgs.config.allowUnfree = true;
systemd.services.bluetooth.serviceConfig = {
TimeoutStopSec = 15;
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings = {
substituters = [
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
#nix.package = pkgs.nixVersions.latest;
#nix.package = pkgs.nixVersions.git;
nix.package = pkgs.lix;
systemd.extraConfig = "DefaultLimitNOFILE=4096";
nix.registry.system.flake = inputs.self;
nix.settings.auto-optimise-store = true;
virtualisation.containers.enable = true;
virtualisation.podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
# Required for containers under podman-compose to be able to talk to each other.
defaultNetwork.settings.dns_enabled = true;
};
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModprobeConfig = ''
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
'';
security.polkit.enable = true;
nix.gc = {
automatic = true;
persistent = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/London";
# Select internationalisation properties.
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";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "gb";
variant = "";
};
# Configure console keymap
console.keyMap = "uk";
# this is just so nix doesn't worry about zsh being missing
programs.zsh.enable = true;
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
programs.nix-index-database.comma.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.wumpus = {
isNormalUser = true;
description = "wumpus";
extraGroups = [
"dialout"
"networkmanager"
"wheel"
];
shell = pkgs.zsh;
packages = with pkgs; [
];
};
home-manager = {
extraSpecialArgs = {
inherit inputs;
};
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "tmp.${inputs.self.my_timestamp}";
users = {
"wumpus" = ./home.nix;
};
};
environment.interactiveShellInit = # bash
''
unlink-copy() {
cp "$1" "$1.tmp"
unlink "$1"
mv "$1.tmp" "$1"
chmod -R 777 "$1"
}
dev() {
nix develop system#"$1" -c zsh
}
'';
# Allow unfree packages
#nixpkgs.config.allowUnfree = true;
#nixpkgs.overlays = [ inputs.neovim.overlay ];
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
sof-firmware
# bluetooth info for ags
gnome-bluetooth
manix
steam-run
mpv
distrobox
docker-compose
# themes
libsForQt5.qtstyleplugin-kvantum
libsForQt5.qt5ct
(pkgs.catppuccin-sddm.override {
flavor = "macchiato";
font = "Noto Sans";
fontSize = "15";
background = "${./assets/nix.jpg}";
loginBackground = true;
})
# git packages
git
gh
libsecret
# apps
spotify
vesktop
kid3
yt-dlp
prismlauncher
r2modman
bitwarden-desktop
# productivity
libreoffice-qt
hunspell
hunspellDicts.en_GB-ize
inputs.my-nvim.packages.${pkgs.system}.default
];
# thunar
programs.thunar.enable = true;
programs.xfconf.enable = true;
services.tumbler.enable = true;
## AGS
# power info
services.upower.enable = true;
# caching of cover art
services.gvfs.enable = true;
services.flatpak.debug = true;
services.flatpak.enable = true;
# docs: https://github.com/GermanBread/declarative-flatpak/blob/dev/docs/definition.md
services.flatpak.overrides = {
"global" = {
filesystems = [
#"host"
"/mnt"
];
};
#"dev.bambosh.UnofficialHomestuckCollection".filesystems = [ "host" "xdg-download" "home" "/mnt" ];
};
services.flatpak.packages = [
"flathub:app/com.heroicgameslauncher.hgl//stable"
"flathub:app/dev.bambosh.UnofficialHomestuckCollection//stable"
"flathub:app/com.github.tchx84.Flatseal//stable"
];
services.flatpak.remotes = {
"flathub" = "https://dl.flathub.org/repo/flathub.flatpakrepo";
"flathub-beta" = "https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo";
};
# fonts
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
#noto-fonts-monochrome-emoji
noto-fonts-emoji
meslo-lgs-nf
rubik
];
environment.variables.QT_QPA_PLATFORMTHEME = "qt5ct";
environment.variables.HOSTNAME = config.networking.hostName;
# 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;
# };
programs.hyprland.enable = true;
programs.hyprland.package = inputs.hyprland.packages.${pkgs.system}.hyprland;
# mime type setup
environment.sessionVariables.DEFAULT_BROWSER = "${pkgs.google-chrome}/bin/google-chrome-stable";
xdg.mime.enable = true;
xdg.mime.defaultApplications = {
"text/html" = "google-chrome.desktop";
"x-scheme-handler/https" = "google-chrome.desktop";
"x-scheme-handler/about" = "google-chrome.desktop";
"x-scheme-handler/unknown" = "google-chrome.desktop";
};
# allow appimages to run
programs.appimage.binfmt = true;
# sound setup
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
hardware.enableAllFirmware = true;
programs.steam = {
enable = true;
#TODO: figure this out
#package = pkgs.steam.override { commandLineArgs = [ "-vgui" ]; };
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
gamescopeSession.enable = true;
};
services.libinput.enable = false;
services.xserver.synaptics.enable = true;
security.pam.services.hyprlock = { };
services.xserver.enable = true;
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
theme = "catppuccin-macchiato";
package = pkgs.kdePackages.sddm;
};
hardware.bluetooth.enable = true;
hardware.bluetooth.settings.General.Experimental = true;
# if desktop hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
services.pipewire.wireplumber.extraConfig = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [
"hsp_hs"
"hsp_ag"
"hfp_hf"
"hfp_ag"
];
};
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
};
}