blob: e09269927e2508fbf32bd821e862461e4ac40ec1 [file] [log] [blame]
Skyler Turner205aff12021-12-20 11:22:57 +00001# Edit this configuration file to define what should be installed on
2# your system. Help is available in the configuration.nix(5) man page
3# and in the NixOS manual (accessible by running ‘nixos-help’).
4
5{ config, pkgs, lib, ... }:
6
Skyler Turner0872be92022-01-24 11:31:38 +00007{
Skyler Turner205aff12021-12-20 11:22:57 +00008 imports =
9 [ # Include the results of the hardware scan.
10 ./hardware-configuration.nix
Skyler Turner444ffc22021-12-20 11:28:06 +000011 ../secrets/networking-configuration.nix
Skyler Turner205aff12021-12-20 11:22:57 +000012 ./packaging-configuration.nix
Skyler Turner657b0492022-02-06 21:42:02 +000013 ./containerd/containerd.nix
Skyler Turner205aff12021-12-20 11:22:57 +000014 ];
15
Skyler Turner32dbfb42021-12-24 15:50:22 +000016 # Prepare nix flakes
17 nix = {
18 package = pkgs.nixFlakes;
19 extraOptions = ''
20 experimental-features = nix-command flakes
21 '';
22 };
23
Skyler Turner205aff12021-12-20 11:22:57 +000024 # Use the systemd-boot EFI boot loader.
25 boot.loader.systemd-boot.enable = true;
26 boot.loader.efi.canTouchEfiVariables = true;
27 boot.loader.grub.useOSProber = true;
28
Skyler Turner7b0051e2021-12-29 15:46:56 +000029 # Enable emulated systems
Skyler Turner107ae412021-12-29 18:34:59 +000030 boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv6l-linux" ];
Skyler Turner7b0051e2021-12-29 15:46:56 +000031
Skyler Turner205aff12021-12-20 11:22:57 +000032 # Enable apparmor
33 security.apparmor.enable = true;
34 security.apparmor.killUnconfinedConfinables = true;
35
36 # Set your time zone.
37 time.timeZone = "Europe/London";
38
39 # Select internationalisation properties.
40 i18n.defaultLocale = "en_US.UTF-8";
41 console = {
42 font = "Lat2-Terminus16";
43 keyMap = "uk";
44 };
45
46 # Enable the X11 windowing system.
47 services.xserver = {
48 enable = true;
49 desktopManager = {
50 xterm.enable = false;
51 # xfce.enable = true;
52 };
Skyler Turner27ee4cb2022-03-06 22:29:09 +000053 displayManager.startx.enable = true;
54 # displayManager.sddm.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +000055 };
56
Skyler Turner072db1e2022-02-27 01:01:59 +000057 services = {
58 syncthing = {
59 enable = true;
60 user = "minion";
61 dataDir = "/home/minion/Documents"; # Default folder for new synced folders
62 configDir = "/home/minion/.config/syncthing"; # Folder for Syncthing's settings and keys
63 };
64 };
65
Skyler Turner205aff12021-12-20 11:22:57 +000066 # And wayland
Skyler Turner27ee4cb2022-03-06 22:29:09 +000067/* programs.sway = {
Skyler Turner205aff12021-12-20 11:22:57 +000068 enable = true;
69 wrapperFeatures.gtk = true; # so that gtk works properly
70 extraPackages = with pkgs; [
71 swaylock
72 swayidle
73 wl-clipboard
74 mako # notification daemon
75 alacritty # Alacritty is the default terminal in the config
Skyler Turner205aff12021-12-20 11:22:57 +000076 ];
Skyler Turner27ee4cb2022-03-06 22:29:09 +000077 };*/
Skyler Turner205aff12021-12-20 11:22:57 +000078
Skyler Turner98617fd2022-04-05 21:56:26 +010079 programs.qt5ct = {
80 enable = true;
81 };
Skyler Turner27ee4cb2022-03-06 22:29:09 +000082# programs.waybar.enable = false; # true;
Skyler Turnere24f21c2022-02-06 16:02:53 +000083
Skyler Turner205aff12021-12-20 11:22:57 +000084 # Get screensharing to work
85 xdg = {
86 portal = {
87 enable = true;
88 extraPortals = with pkgs; [
89 xdg-desktop-portal-wlr
Skyler Turnere8b7af22022-03-21 00:05:17 +000090# xdg-desktop-portal-gtk
91# xdg-desktop-portal-kde
Skyler Turner205aff12021-12-20 11:22:57 +000092 ];
Skyler Turnere8b7af22022-03-21 00:05:17 +000093# gtkUsePortal = true;
Skyler Turner84ec77c2022-01-14 09:05:57 +000094 wlr.enable = true;
95
Skyler Turner205aff12021-12-20 11:22:57 +000096 };
97 };
98
Skyler Turner69ca44c2022-03-09 06:56:20 +000099 systemd.user.services.xdg-desktop-portal = {
100 unitConfig = {
101 After = "graphical-session.target";
102 };
103 };
104
Skyler Turner205aff12021-12-20 11:22:57 +0000105 # Configure keymap in X11
106 services.xserver.layout = "gb";
107 # services.xserver.xkbOptions = "eurosign:e";
Skyler Turner55c8ee82022-03-08 19:22:16 +0000108 services.upower.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000109
110 # Permit and install steam
111 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
112 "steam"
113 "steam-original"
114 "steam-runtime"
115 ];
116
117 programs.steam.enable = true;
118
119
120 # Enable CUPS to print documents.
121 services.printing.enable = true;
122
123 # Enable sound.
124 sound.enable = true;
125 hardware.pulseaudio.enable = false;
126 services.pipewire = {
127 enable = true;
128 alsa = {
129 enable = true;
130 support32Bit = true;
131 };
132 pulse.enable = true;
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000133 /*config.pipewire = {
Skyler Turner074765b2022-02-20 10:46:58 +0000134 "context.modules" = [
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000135 {
Skyler Turner074765b2022-02-20 10:46:58 +0000136 name = "libpipewire-module-filter-chain";
137 args = {
138 "node.name" = "effect_output.virtual-surround-7.1-hesuvi";
139 "node.description" = "Virtual Surround Sink";
140 "media.name" = "Virtual Surround Sink";
141 nodes = [
142 # duplicate inputs
143 { type = "builtin"; label = "copy"; name = "copyFL"; }
144 { type = "builtin"; label = "copy"; name = "copyFR"; }
145 { type = "builtin"; label = "copy"; name = "copyFC"; }
146 { type = "builtin"; label = "copy"; name = "copyRL"; }
147 { type = "builtin"; label = "copy"; name = "copyRR"; }
148 { type = "builtin"; label = "copy"; name = "copySL"; }
149 { type = "builtin"; label = "copy"; name = "copySR"; }
150 { type = "builtin"; label = "copy"; name = "copyLFE"; }
151
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000152 # apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: 44 in HeSuVi are the same, but resampled to 44100)
Skyler Turner074765b2022-02-20 10:46:58 +0000153 { type = "builtin"; label = "convolver"; name = "convFL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 0; }; }
154 { type = "builtin"; label = "convolver"; name = "convFL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 1; }; }
155 { type = "builtin"; label = "convolver"; name = "convSL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 2; }; }
156 { type = "builtin"; label = "convolver"; name = "convSL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 3; }; }
157 { type = "builtin"; label = "convolver"; name = "convRL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 4; }; }
158 { type = "builtin"; label = "convolver"; name = "convRL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 5; }; }
159 { type = "builtin"; label = "convolver"; name = "convFC_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
160 { type = "builtin"; label = "convolver"; name = "convFR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 7; }; }
161 { type = "builtin"; label = "convolver"; name = "convFR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 8; }; }
162 { type = "builtin"; label = "convolver"; name = "convSR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 9; }; }
163 { type = "builtin"; label = "convolver"; name = "convSR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 10; }; }
164 { type = "builtin"; label = "convolver"; name = "convRR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 11; }; }
165 { type = "builtin"; label = "convolver"; name = "convRR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 12; }; }
166 { type = "builtin"; label = "convolver"; name = "convFC_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
167
168 # treat LFE as FC
169 { type = "builtin"; label = "convolver"; name = "convLFE_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
170 { type = "builtin"; label = "convolver"; name = "convLFE_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
171
172 # stereo output
173 { type = "builtin"; label = "mixer"; name = "mixR"; }
174 { type = "builtin"; label = "mixer"; name = "mixL"; }
175 ];
176 links = [
177 # input
178 { output = "copyFL:Out"; input="convFL_L:In"; }
179 { output = "copyFL:Out"; input="convFL_R:In"; }
180 { output = "copySL:Out"; input="convSL_L:In"; }
181 { output = "copySL:Out"; input="convSL_R:In"; }
182 { output = "copyRL:Out"; input="convRL_L:In"; }
183 { output = "copyRL:Out"; input="convRL_R:In"; }
184 { output = "copyFC:Out"; input="convFC_L:In"; }
185 { output = "copyFR:Out"; input="convFR_R:In"; }
186 { output = "copyFR:Out"; input="convFR_L:In"; }
187 { output = "copySR:Out"; input="convSR_R:In"; }
188 { output = "copySR:Out"; input="convSR_L:In"; }
189 { output = "copyRR:Out"; input="convRR_R:In"; }
190 { output = "copyRR:Out"; input="convRR_L:In"; }
191 { output = "copyFC:Out"; input="convFC_R:In"; }
192 { output = "copyLFE:Out"; input="convLFE_L:In"; }
193 { output = "copyLFE:Out"; input="convLFE_R:In"; }
194
195 # output
196 { output = "convFL_L:Out"; input="mixL:In 1"; }
197 { output = "convFL_R:Out"; input="mixR:In 1"; }
198 { output = "convSL_L:Out"; input="mixL:In 2"; }
199 { output = "convSL_R:Out"; input="mixR:In 2"; }
200 { output = "convRL_L:Out"; input="mixL:In 3"; }
201 { output = "convRL_R:Out"; input="mixR:In 3"; }
202 { output = "convFC_L:Out"; input="mixL:In 4"; }
203 { output = "convFC_R:Out"; input="mixR:In 4"; }
204 { output = "convFR_R:Out"; input="mixR:In 5"; }
205 { output = "convFR_L:Out"; input="mixL:In 5"; }
206 { output = "convSR_R:Out"; input="mixR:In 6"; }
207 { output = "convSR_L:Out"; input="mixL:In 6"; }
208 { output = "convRR_R:Out"; input="mixR:In 7"; }
209 { output = "convRR_L:Out"; input="mixL:In 7"; }
210 { output = "convLFE_R:Out"; input="mixR:In 8"; }
211 { output = "convLFE_L:Out"; input="mixL:In 8"; }
212 ];
213 inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In" "copySL:In" "copySR:In" ];
214 outputs = [ "mixL:Out" "mixR:Out" ];
215 };
216 "capture.props" = {
217 "media.class" = "Audio/Sink";
218 "audio.channels" = 8;
219 "audio.position" = [ "FL" "FR" "FC" "LFE" "RL" "RR" "SL" "SR" ];
220 };
221 "playback.props" = {
222 "node.passive" = true;
223 "audio.channels" = 2;
224 "audio.position" = [ "FL" "FR" ];
225 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000226 }
227 ];
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000228 };*/
Skyler Turner205aff12021-12-20 11:22:57 +0000229 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000230 environment.etc."pipewire/7.1-surround-sound.conf".source = ./pipewire/7.1-surround-sound.conf;
Skyler Turner205aff12021-12-20 11:22:57 +0000231
Skyler Turner716da2d2022-02-20 20:40:02 +0000232 hardware.openrazer.enable = true;
233 hardware.openrazer.users = [ "minion" ];
234
Skyler Turner0bb4f842022-04-05 20:27:22 +0100235 hardware.steam-hardware.enable = true;
236
Skyler Turner205aff12021-12-20 11:22:57 +0000237 # Enable touchpad support (enabled default in most desktopManager).
238 services.xserver.libinput.enable = true;
239
Skyler Turnerbe543712022-03-08 19:21:06 +0000240 programs.dconf.enable = true;
Skyler Turner7145c2d2022-03-08 19:19:10 +0000241
Skyler Turner205aff12021-12-20 11:22:57 +0000242 # Define a user account. Don't forget to set a password with ‘passwd’.
243 users.users.minion = {
244 isNormalUser = true;
Skyler Turnere9893c92022-03-13 15:37:58 +0000245 extraGroups = [ "wheel" "kvm" "docker" "containerd" "dialout" "libvirtd" ]; # Enable ‘sudo’ for the user.
Skyler Turner7fe8a242022-02-06 00:42:28 +0000246 shell = pkgs.zsh;
Skyler Turner205aff12021-12-20 11:22:57 +0000247 };
248
Skyler Turner36ed4592022-04-05 22:15:02 +0100249 pkgs.zsh.enable = true;
250
Skyler Turner205aff12021-12-20 11:22:57 +0000251 # List packages installed in system profile. To search, run:
252 # $ nix search wget
Skyler Turnera3ab14b2022-01-24 11:37:41 +0000253 environment.systemPackages = with pkgs; [
Skyler Turner205aff12021-12-20 11:22:57 +0000254 vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
255 ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
256 epkgs.vterm
257 epkgs.emacsql-sqlite
258 ])) # Emacs + vterm-module (needed for vterm)
259 wget
260 firefox
261 chromium # Install chromium if needed
262 texlive.combined.scheme-full
Skyler Turner205aff12021-12-20 11:22:57 +0000263 keybase-gui
Skyler Turneree73be42022-01-10 11:02:46 +0000264 bluez
Skyler Turner1a7d0b42022-01-18 10:27:32 +0000265 macchanger
Skyler Turnerb4541be2022-01-21 19:38:55 +0000266 comic-relief
Skyler Turnerb408dcf2022-02-04 23:48:08 +0000267 qemu_kvm
Skyler Turner5954aae2022-02-06 16:03:51 +0000268 polkit_gnome
Skyler Turner785a8a62022-02-06 16:12:59 +0000269 gtk-engine-murrine
270 gtk_engines
271 gsettings-desktop-schemas
272 lxappearance
Skyler Turner98617fd2022-04-05 21:56:26 +0100273 libsForQt5.qt5.qtwayland
Skyler Turnerbfe0f542022-02-06 21:45:00 +0000274 ] ++ (import ./containerd/systemPackages.nix pkgs).systemPackages;
Skyler Turner205aff12021-12-20 11:22:57 +0000275
276# environment.systemPackages = [
277# import /scripts/jetbrains.rider.nix
278# ];
279
280 fonts.fonts = with pkgs; [
281 nerdfonts
282 noto-fonts
283 noto-fonts-cjk
284 noto-fonts-emoji
285 liberation_ttf
286 fira-code
287 fira-code-symbols
288 mplus-outline-fonts
289 dina-font
290 proggyfonts
291 roboto
292 ];
293
294 # Some programs need SUID wrappers, can be configured further or are
295 # started in user sessions.
296 programs.mtr.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000297 programs.kdeconnect.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000298 programs.gnupg.agent = {
299 enable = true;
300 enableSSHSupport = true;
301 };
302
303 # List services that you want to enable:
304
305 # Enable the OpenSSH daemon.
306 services.openssh.enable = true;
307 services.keybase.enable = true;
Skyler Turnera6cfb632022-01-16 23:03:43 +0000308 services.kbfs.enable = true;
309 services.kbfs.enableRedirector = true;
Skyler Turnercde828a2022-02-02 09:41:56 +0000310 security.wrappers.keybase-redirector.owner = "root";
Skyler Turnera620ae92022-02-24 08:26:31 +0000311 security.wrappers.keybase-redirector.group = "users";
Skyler Turner205aff12021-12-20 11:22:57 +0000312 services.gnome.gnome-keyring.enable = true;
313 services.i2p.enable = true;
Skyler Turner87637252022-02-01 12:28:51 +0000314 services.tlp.enable = true;
Skyler Turner67c6fd82022-03-15 17:42:30 +0000315
Skyler Turner32dbfb42021-12-24 15:50:22 +0000316 virtualisation.docker.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000317 virtualisation.docker.enableOnBoot = false;
Skyler Turnere9893c92022-03-13 15:37:58 +0000318 virtualisation.libvirtd.enable = true;
319 virtualisation.libvirtd.onBoot = "ignore";
Skyler Turner205aff12021-12-20 11:22:57 +0000320
Skyler Turnerfff67b52022-02-08 21:29:33 +0000321 hardware.bluetooth.enable = true;
322
Skyler Turner5954aae2022-02-06 16:03:51 +0000323 environment.pathsToLink = [ "/share/zsh" "/libexec" ];
Skyler Turner1035c8c2022-02-05 23:43:34 +0000324
Skyler Turner98483702022-02-04 23:25:21 +0000325 virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
Skyler Turner2ee83f82022-02-04 23:18:51 +0000326 virtualisation.kvmgt.enable = true;
327
Skyler Turnerff2168b2022-01-16 16:19:50 +0000328 services.openvpn.servers = {
Skyler Turner3a7d7792022-01-16 16:23:50 +0000329 clicks = { config = '' config /home/minion/Nix/secrets/clicks/client.ovpn ''; };
Skyler Turnerff2168b2022-01-16 16:19:50 +0000330 };
331
Skyler Turnerdf40c9e2022-03-09 09:35:42 +0000332 environment.etc = {
333 "pam.d/swaylock" = {
Skyler Turnerbaa75622022-03-09 09:39:26 +0000334 mode = "0644";
Skyler Turnerdf40c9e2022-03-09 09:35:42 +0000335 text = ''
336 auth include login
337 '';
338 };
339 };
340
Skyler Turner4f5f11b2022-01-14 23:36:39 +0000341 nixpkgs.overlays = [
342 (self: super: {
343 polkit = super.polkit.overrideAttrs (oldAttrs: {
344 patches = oldAttrs.patches ++ [
345 (super.fetchpatch {
346 url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/716a273ce0af467968057f3e107156182bd290b0.patch";
347 sha256 = "sha256-hOJJhUmxXm87W1ZU9Y1NJ8GCyKvPjbIVtCHlhRGlN8k=";
348 })];
349 });
350 })
351 ];
352
Skyler Turnerb0362522022-02-25 09:36:23 +0000353 xdg.mime.defaultApplications = {
354 "text/html" = "chromium-browser.desktop";
355 "x-scheme-handler/http" = "chromium-browser.desktop";
356 "x-scheme-handler/https" = "chromium-browser.desktop";
357 "x-scheme-handler/about" = "chromium-browser.desktop";
358 "x-scheme-handler/unknown" = "chromium-browser.desktop";
359 };
360
Skyler Turner95f68502022-02-25 09:57:21 +0000361 # environment.sessionsVariables.DEFAULT_BROWSER = "${pkgs.chromium}/bin/chromium";
Skyler Turnerb0362522022-02-25 09:36:23 +0000362
363
Skyler Turner95f68502022-02-25 09:57:21 +0000364 boot.supportedFilesystems = [ "kbfs" ];
365
Skyler Turner205aff12021-12-20 11:22:57 +0000366 # This value determines the NixOS release from which the default
367 # settings for stateful data, like file locations and database versions
368 # on your system were taken. It‘s perfectly fine and recommended to leave
369 # this value at the release version of the first install of this system.
370 # Before changing this value read the documentation for this option
371 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
372 system.stateVersion = "21.11"; # Did you read the comment?
373
374}
375