blob: ce14069238a6b5b25088c811fb2e685b8badcdf8 [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, ... }:
Skyler Turner4d3d9622022-05-10 21:54:56 +01006let
7 unstable-pkgs = import <nixos-unstable> { config = { allowUnfree = true; }; };
8in
Skyler Turner0872be92022-01-24 11:31:38 +00009{
Skyler Turner205aff12021-12-20 11:22:57 +000010 imports =
11 [ # Include the results of the hardware scan.
12 ./hardware-configuration.nix
Skyler Turner444ffc22021-12-20 11:28:06 +000013 ../secrets/networking-configuration.nix
Skyler Turner205aff12021-12-20 11:22:57 +000014 ./packaging-configuration.nix
Skyler Turner657b0492022-02-06 21:42:02 +000015 ./containerd/containerd.nix
Skyler Turner205aff12021-12-20 11:22:57 +000016 ];
17
Skyler Turner32dbfb42021-12-24 15:50:22 +000018 # Prepare nix flakes
19 nix = {
20 package = pkgs.nixFlakes;
21 extraOptions = ''
22 experimental-features = nix-command flakes
23 '';
24 };
25
Skyler Turner205aff12021-12-20 11:22:57 +000026 # Use the systemd-boot EFI boot loader.
27 boot.loader.systemd-boot.enable = true;
28 boot.loader.efi.canTouchEfiVariables = true;
29 boot.loader.grub.useOSProber = true;
30
Skyler Turner7b0051e2021-12-29 15:46:56 +000031 # Enable emulated systems
Skyler Turner107ae412021-12-29 18:34:59 +000032 boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv6l-linux" ];
Skyler Turner7b0051e2021-12-29 15:46:56 +000033
Skyler Turner205aff12021-12-20 11:22:57 +000034 # Enable apparmor
35 security.apparmor.enable = true;
36 security.apparmor.killUnconfinedConfinables = true;
37
38 # Set your time zone.
39 time.timeZone = "Europe/London";
40
41 # Select internationalisation properties.
42 i18n.defaultLocale = "en_US.UTF-8";
43 console = {
44 font = "Lat2-Terminus16";
45 keyMap = "uk";
46 };
47
48 # Enable the X11 windowing system.
49 services.xserver = {
50 enable = true;
51 desktopManager = {
52 xterm.enable = false;
53 # xfce.enable = true;
54 };
Skyler Turner27ee4cb2022-03-06 22:29:09 +000055 displayManager.startx.enable = true;
56 # displayManager.sddm.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +000057 };
58
Skyler Turner072db1e2022-02-27 01:01:59 +000059 services = {
60 syncthing = {
61 enable = true;
62 user = "minion";
63 dataDir = "/home/minion/Documents"; # Default folder for new synced folders
64 configDir = "/home/minion/.config/syncthing"; # Folder for Syncthing's settings and keys
65 };
66 };
67
Skyler Turner205aff12021-12-20 11:22:57 +000068 # And wayland
Skyler Turner27ee4cb2022-03-06 22:29:09 +000069/* programs.sway = {
Skyler Turner205aff12021-12-20 11:22:57 +000070 enable = true;
71 wrapperFeatures.gtk = true; # so that gtk works properly
72 extraPackages = with pkgs; [
73 swaylock
74 swayidle
75 wl-clipboard
76 mako # notification daemon
77 alacritty # Alacritty is the default terminal in the config
Skyler Turner205aff12021-12-20 11:22:57 +000078 ];
Skyler Turner27ee4cb2022-03-06 22:29:09 +000079 };*/
Skyler Turner205aff12021-12-20 11:22:57 +000080
Skyler Turner98617fd2022-04-05 21:56:26 +010081 programs.qt5ct = {
82 enable = true;
83 };
Skyler Turner27ee4cb2022-03-06 22:29:09 +000084# programs.waybar.enable = false; # true;
Skyler Turnere24f21c2022-02-06 16:02:53 +000085
Skyler Turner205aff12021-12-20 11:22:57 +000086 # Get screensharing to work
87 xdg = {
88 portal = {
89 enable = true;
90 extraPortals = with pkgs; [
91 xdg-desktop-portal-wlr
Skyler Turnere8b7af22022-03-21 00:05:17 +000092# xdg-desktop-portal-gtk
93# xdg-desktop-portal-kde
Skyler Turner205aff12021-12-20 11:22:57 +000094 ];
Skyler Turnere8b7af22022-03-21 00:05:17 +000095# gtkUsePortal = true;
Skyler Turner84ec77c2022-01-14 09:05:57 +000096 wlr.enable = true;
97
Skyler Turner205aff12021-12-20 11:22:57 +000098 };
99 };
100
Skyler Turner69ca44c2022-03-09 06:56:20 +0000101 systemd.user.services.xdg-desktop-portal = {
102 unitConfig = {
103 After = "graphical-session.target";
104 };
105 };
106
Skyler Turner205aff12021-12-20 11:22:57 +0000107 # Configure keymap in X11
108 services.xserver.layout = "gb";
109 # services.xserver.xkbOptions = "eurosign:e";
Skyler Turner55c8ee82022-03-08 19:22:16 +0000110 services.upower.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000111
112 # Permit and install steam
113 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
114 "steam"
115 "steam-original"
116 "steam-runtime"
Skyler Turner5f220932022-05-10 23:45:01 +0100117 "mongodb"
Skyler Turner205aff12021-12-20 11:22:57 +0000118 ];
119
120 programs.steam.enable = true;
121
122
123 # Enable CUPS to print documents.
124 services.printing.enable = true;
125
126 # Enable sound.
127 sound.enable = true;
128 hardware.pulseaudio.enable = false;
129 services.pipewire = {
130 enable = true;
131 alsa = {
132 enable = true;
133 support32Bit = true;
134 };
135 pulse.enable = true;
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000136 /*config.pipewire = {
Skyler Turner074765b2022-02-20 10:46:58 +0000137 "context.modules" = [
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000138 {
Skyler Turner074765b2022-02-20 10:46:58 +0000139 name = "libpipewire-module-filter-chain";
140 args = {
141 "node.name" = "effect_output.virtual-surround-7.1-hesuvi";
142 "node.description" = "Virtual Surround Sink";
143 "media.name" = "Virtual Surround Sink";
144 nodes = [
145 # duplicate inputs
146 { type = "builtin"; label = "copy"; name = "copyFL"; }
147 { type = "builtin"; label = "copy"; name = "copyFR"; }
148 { type = "builtin"; label = "copy"; name = "copyFC"; }
149 { type = "builtin"; label = "copy"; name = "copyRL"; }
150 { type = "builtin"; label = "copy"; name = "copyRR"; }
151 { type = "builtin"; label = "copy"; name = "copySL"; }
152 { type = "builtin"; label = "copy"; name = "copySR"; }
153 { type = "builtin"; label = "copy"; name = "copyLFE"; }
154
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000155 # 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 +0000156 { type = "builtin"; label = "convolver"; name = "convFL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 0; }; }
157 { type = "builtin"; label = "convolver"; name = "convFL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 1; }; }
158 { type = "builtin"; label = "convolver"; name = "convSL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 2; }; }
159 { type = "builtin"; label = "convolver"; name = "convSL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 3; }; }
160 { type = "builtin"; label = "convolver"; name = "convRL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 4; }; }
161 { type = "builtin"; label = "convolver"; name = "convRL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 5; }; }
162 { type = "builtin"; label = "convolver"; name = "convFC_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
163 { type = "builtin"; label = "convolver"; name = "convFR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 7; }; }
164 { type = "builtin"; label = "convolver"; name = "convFR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 8; }; }
165 { type = "builtin"; label = "convolver"; name = "convSR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 9; }; }
166 { type = "builtin"; label = "convolver"; name = "convSR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 10; }; }
167 { type = "builtin"; label = "convolver"; name = "convRR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 11; }; }
168 { type = "builtin"; label = "convolver"; name = "convRR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 12; }; }
169 { type = "builtin"; label = "convolver"; name = "convFC_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
170
171 # treat LFE as FC
172 { type = "builtin"; label = "convolver"; name = "convLFE_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
173 { type = "builtin"; label = "convolver"; name = "convLFE_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
174
175 # stereo output
176 { type = "builtin"; label = "mixer"; name = "mixR"; }
177 { type = "builtin"; label = "mixer"; name = "mixL"; }
178 ];
179 links = [
180 # input
181 { output = "copyFL:Out"; input="convFL_L:In"; }
182 { output = "copyFL:Out"; input="convFL_R:In"; }
183 { output = "copySL:Out"; input="convSL_L:In"; }
184 { output = "copySL:Out"; input="convSL_R:In"; }
185 { output = "copyRL:Out"; input="convRL_L:In"; }
186 { output = "copyRL:Out"; input="convRL_R:In"; }
187 { output = "copyFC:Out"; input="convFC_L:In"; }
188 { output = "copyFR:Out"; input="convFR_R:In"; }
189 { output = "copyFR:Out"; input="convFR_L:In"; }
190 { output = "copySR:Out"; input="convSR_R:In"; }
191 { output = "copySR:Out"; input="convSR_L:In"; }
192 { output = "copyRR:Out"; input="convRR_R:In"; }
193 { output = "copyRR:Out"; input="convRR_L:In"; }
194 { output = "copyFC:Out"; input="convFC_R:In"; }
195 { output = "copyLFE:Out"; input="convLFE_L:In"; }
196 { output = "copyLFE:Out"; input="convLFE_R:In"; }
197
198 # output
199 { output = "convFL_L:Out"; input="mixL:In 1"; }
200 { output = "convFL_R:Out"; input="mixR:In 1"; }
201 { output = "convSL_L:Out"; input="mixL:In 2"; }
202 { output = "convSL_R:Out"; input="mixR:In 2"; }
203 { output = "convRL_L:Out"; input="mixL:In 3"; }
204 { output = "convRL_R:Out"; input="mixR:In 3"; }
205 { output = "convFC_L:Out"; input="mixL:In 4"; }
206 { output = "convFC_R:Out"; input="mixR:In 4"; }
207 { output = "convFR_R:Out"; input="mixR:In 5"; }
208 { output = "convFR_L:Out"; input="mixL:In 5"; }
209 { output = "convSR_R:Out"; input="mixR:In 6"; }
210 { output = "convSR_L:Out"; input="mixL:In 6"; }
211 { output = "convRR_R:Out"; input="mixR:In 7"; }
212 { output = "convRR_L:Out"; input="mixL:In 7"; }
213 { output = "convLFE_R:Out"; input="mixR:In 8"; }
214 { output = "convLFE_L:Out"; input="mixL:In 8"; }
215 ];
216 inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In" "copySL:In" "copySR:In" ];
217 outputs = [ "mixL:Out" "mixR:Out" ];
218 };
219 "capture.props" = {
220 "media.class" = "Audio/Sink";
221 "audio.channels" = 8;
222 "audio.position" = [ "FL" "FR" "FC" "LFE" "RL" "RR" "SL" "SR" ];
223 };
224 "playback.props" = {
225 "node.passive" = true;
226 "audio.channels" = 2;
227 "audio.position" = [ "FL" "FR" ];
228 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000229 }
230 ];
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000231 };*/
Skyler Turner205aff12021-12-20 11:22:57 +0000232 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000233 environment.etc."pipewire/7.1-surround-sound.conf".source = ./pipewire/7.1-surround-sound.conf;
Skyler Turner205aff12021-12-20 11:22:57 +0000234
Skyler Turner716da2d2022-02-20 20:40:02 +0000235 hardware.openrazer.enable = true;
236 hardware.openrazer.users = [ "minion" ];
237
Skyler Turner0bb4f842022-04-05 20:27:22 +0100238 hardware.steam-hardware.enable = true;
239
Skyler Turner205aff12021-12-20 11:22:57 +0000240 # Enable touchpad support (enabled default in most desktopManager).
241 services.xserver.libinput.enable = true;
242
Skyler Turnerbe543712022-03-08 19:21:06 +0000243 programs.dconf.enable = true;
Skyler Turner7145c2d2022-03-08 19:19:10 +0000244
Skyler Turner205aff12021-12-20 11:22:57 +0000245 # Define a user account. Don't forget to set a password with ‘passwd’.
246 users.users.minion = {
247 isNormalUser = true;
Skyler Turnere9893c92022-03-13 15:37:58 +0000248 extraGroups = [ "wheel" "kvm" "docker" "containerd" "dialout" "libvirtd" ]; # Enable ‘sudo’ for the user.
Skyler Turner7fe8a242022-02-06 00:42:28 +0000249 shell = pkgs.zsh;
Skyler Turner205aff12021-12-20 11:22:57 +0000250 };
251
Skyler Turnerb8f440b2022-04-05 22:18:44 +0100252 programs.zsh.enable = true;
Skyler Turner36ed4592022-04-05 22:15:02 +0100253
Skyler Turner205aff12021-12-20 11:22:57 +0000254 # List packages installed in system profile. To search, run:
255 # $ nix search wget
Skyler Turnera3ab14b2022-01-24 11:37:41 +0000256 environment.systemPackages = with pkgs; [
Skyler Turner205aff12021-12-20 11:22:57 +0000257 vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
258 ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
259 epkgs.vterm
260 epkgs.emacsql-sqlite
261 ])) # Emacs + vterm-module (needed for vterm)
262 wget
263 firefox
264 chromium # Install chromium if needed
265 texlive.combined.scheme-full
Skyler Turner205aff12021-12-20 11:22:57 +0000266 keybase-gui
Skyler Turneree73be42022-01-10 11:02:46 +0000267 bluez
Skyler Turner1a7d0b42022-01-18 10:27:32 +0000268 macchanger
Skyler Turnerb4541be2022-01-21 19:38:55 +0000269 comic-relief
Skyler Turnerb408dcf2022-02-04 23:48:08 +0000270 qemu_kvm
Skyler Turner5954aae2022-02-06 16:03:51 +0000271 polkit_gnome
Skyler Turner785a8a62022-02-06 16:12:59 +0000272 gtk-engine-murrine
273 gtk_engines
274 gsettings-desktop-schemas
275 lxappearance
Skyler Turner98617fd2022-04-05 21:56:26 +0100276 libsForQt5.qt5.qtwayland
Skyler Turnerbfe0f542022-02-06 21:45:00 +0000277 ] ++ (import ./containerd/systemPackages.nix pkgs).systemPackages;
Skyler Turner205aff12021-12-20 11:22:57 +0000278
279# environment.systemPackages = [
280# import /scripts/jetbrains.rider.nix
281# ];
282
Skyler Turner3c940042022-05-10 21:20:12 +0100283 services.mongodb = {
Skyler Turnerd80e68e2022-05-10 22:43:00 +0100284 package = pkgs.mongodb-4_2;
Skyler Turner3c940042022-05-10 21:20:12 +0100285 enable = true;
286 dbpath = "/tmp/mongodb";
287 };
288
Skyler Turner205aff12021-12-20 11:22:57 +0000289 fonts.fonts = with pkgs; [
290 nerdfonts
291 noto-fonts
292 noto-fonts-cjk
293 noto-fonts-emoji
294 liberation_ttf
295 fira-code
296 fira-code-symbols
297 mplus-outline-fonts
298 dina-font
299 proggyfonts
300 roboto
301 ];
302
303 # Some programs need SUID wrappers, can be configured further or are
304 # started in user sessions.
305 programs.mtr.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000306 programs.kdeconnect.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000307 programs.gnupg.agent = {
308 enable = true;
309 enableSSHSupport = true;
310 };
311
312 # List services that you want to enable:
313
314 # Enable the OpenSSH daemon.
315 services.openssh.enable = true;
316 services.keybase.enable = true;
Skyler Turnera6cfb632022-01-16 23:03:43 +0000317 services.kbfs.enable = true;
318 services.kbfs.enableRedirector = true;
Skyler Turnercde828a2022-02-02 09:41:56 +0000319 security.wrappers.keybase-redirector.owner = "root";
Skyler Turnera620ae92022-02-24 08:26:31 +0000320 security.wrappers.keybase-redirector.group = "users";
Skyler Turner205aff12021-12-20 11:22:57 +0000321 services.gnome.gnome-keyring.enable = true;
322 services.i2p.enable = true;
Skyler Turner87637252022-02-01 12:28:51 +0000323 services.tlp.enable = true;
Skyler Turner67c6fd82022-03-15 17:42:30 +0000324
Skyler Turner32dbfb42021-12-24 15:50:22 +0000325 virtualisation.docker.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000326 virtualisation.docker.enableOnBoot = false;
Skyler Turnere9893c92022-03-13 15:37:58 +0000327 virtualisation.libvirtd.enable = true;
328 virtualisation.libvirtd.onBoot = "ignore";
Skyler Turner205aff12021-12-20 11:22:57 +0000329
Skyler Turnerfff67b52022-02-08 21:29:33 +0000330 hardware.bluetooth.enable = true;
331
Skyler Turner5954aae2022-02-06 16:03:51 +0000332 environment.pathsToLink = [ "/share/zsh" "/libexec" ];
Skyler Turner1035c8c2022-02-05 23:43:34 +0000333
Skyler Turner98483702022-02-04 23:25:21 +0000334 virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
Skyler Turner2ee83f82022-02-04 23:18:51 +0000335 virtualisation.kvmgt.enable = true;
336
Skyler Turnerff2168b2022-01-16 16:19:50 +0000337 services.openvpn.servers = {
Skyler Turner3a7d7792022-01-16 16:23:50 +0000338 clicks = { config = '' config /home/minion/Nix/secrets/clicks/client.ovpn ''; };
Skyler Turnerff2168b2022-01-16 16:19:50 +0000339 };
340
Skyler Turnerdf40c9e2022-03-09 09:35:42 +0000341 environment.etc = {
342 "pam.d/swaylock" = {
Skyler Turnerbaa75622022-03-09 09:39:26 +0000343 mode = "0644";
Skyler Turnerdf40c9e2022-03-09 09:35:42 +0000344 text = ''
345 auth include login
346 '';
347 };
348 };
349
Skyler Turner4f5f11b2022-01-14 23:36:39 +0000350 nixpkgs.overlays = [
351 (self: super: {
352 polkit = super.polkit.overrideAttrs (oldAttrs: {
353 patches = oldAttrs.patches ++ [
354 (super.fetchpatch {
355 url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/716a273ce0af467968057f3e107156182bd290b0.patch";
356 sha256 = "sha256-hOJJhUmxXm87W1ZU9Y1NJ8GCyKvPjbIVtCHlhRGlN8k=";
357 })];
358 });
359 })
360 ];
361
Skyler Turnerb0362522022-02-25 09:36:23 +0000362 xdg.mime.defaultApplications = {
363 "text/html" = "chromium-browser.desktop";
364 "x-scheme-handler/http" = "chromium-browser.desktop";
365 "x-scheme-handler/https" = "chromium-browser.desktop";
366 "x-scheme-handler/about" = "chromium-browser.desktop";
367 "x-scheme-handler/unknown" = "chromium-browser.desktop";
368 };
369
Skyler Turner95f68502022-02-25 09:57:21 +0000370 # environment.sessionsVariables.DEFAULT_BROWSER = "${pkgs.chromium}/bin/chromium";
Skyler Turnerb0362522022-02-25 09:36:23 +0000371
372
Skyler Turner95f68502022-02-25 09:57:21 +0000373 boot.supportedFilesystems = [ "kbfs" ];
374
Skyler Turner205aff12021-12-20 11:22:57 +0000375 # This value determines the NixOS release from which the default
376 # settings for stateful data, like file locations and database versions
377 # on your system were taken. It‘s perfectly fine and recommended to leave
378 # this value at the release version of the first install of this system.
379 # Before changing this value read the documentation for this option
380 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
381 system.stateVersion = "21.11"; # Did you read the comment?
382
383}
384