blob: 76045e4628d5ba1672a61a94a6d36f52d0d94dd4 [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 Turneref649b02022-02-06 16:05:24 +000079 programs.qt5ct.enable = true;
Skyler Turner27ee4cb2022-03-06 22:29:09 +000080# programs.waybar.enable = false; # true;
Skyler Turnere24f21c2022-02-06 16:02:53 +000081
Skyler Turner205aff12021-12-20 11:22:57 +000082 # Get screensharing to work
83 xdg = {
84 portal = {
85 enable = true;
86 extraPortals = with pkgs; [
87 xdg-desktop-portal-wlr
88 xdg-desktop-portal-gtk
89 ];
90 gtkUsePortal = true;
Skyler Turner84ec77c2022-01-14 09:05:57 +000091 wlr.enable = true;
92
Skyler Turner205aff12021-12-20 11:22:57 +000093 };
94 };
95
96 # Configure keymap in X11
97 services.xserver.layout = "gb";
98 # services.xserver.xkbOptions = "eurosign:e";
99
100
101 # Permit and install steam
102 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
103 "steam"
104 "steam-original"
105 "steam-runtime"
106 ];
107
108 programs.steam.enable = true;
109
110
111 # Enable CUPS to print documents.
112 services.printing.enable = true;
113
114 # Enable sound.
115 sound.enable = true;
116 hardware.pulseaudio.enable = false;
117 services.pipewire = {
118 enable = true;
119 alsa = {
120 enable = true;
121 support32Bit = true;
122 };
123 pulse.enable = true;
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000124 /*config.pipewire = {
Skyler Turner074765b2022-02-20 10:46:58 +0000125 "context.modules" = [
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000126 {
Skyler Turner074765b2022-02-20 10:46:58 +0000127 name = "libpipewire-module-filter-chain";
128 args = {
129 "node.name" = "effect_output.virtual-surround-7.1-hesuvi";
130 "node.description" = "Virtual Surround Sink";
131 "media.name" = "Virtual Surround Sink";
132 nodes = [
133 # duplicate inputs
134 { type = "builtin"; label = "copy"; name = "copyFL"; }
135 { type = "builtin"; label = "copy"; name = "copyFR"; }
136 { type = "builtin"; label = "copy"; name = "copyFC"; }
137 { type = "builtin"; label = "copy"; name = "copyRL"; }
138 { type = "builtin"; label = "copy"; name = "copyRR"; }
139 { type = "builtin"; label = "copy"; name = "copySL"; }
140 { type = "builtin"; label = "copy"; name = "copySR"; }
141 { type = "builtin"; label = "copy"; name = "copyLFE"; }
142
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000143 # 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 +0000144 { type = "builtin"; label = "convolver"; name = "convFL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 0; }; }
145 { type = "builtin"; label = "convolver"; name = "convFL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 1; }; }
146 { type = "builtin"; label = "convolver"; name = "convSL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 2; }; }
147 { type = "builtin"; label = "convolver"; name = "convSL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 3; }; }
148 { type = "builtin"; label = "convolver"; name = "convRL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 4; }; }
149 { type = "builtin"; label = "convolver"; name = "convRL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 5; }; }
150 { type = "builtin"; label = "convolver"; name = "convFC_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
151 { type = "builtin"; label = "convolver"; name = "convFR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 7; }; }
152 { type = "builtin"; label = "convolver"; name = "convFR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 8; }; }
153 { type = "builtin"; label = "convolver"; name = "convSR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 9; }; }
154 { type = "builtin"; label = "convolver"; name = "convSR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 10; }; }
155 { type = "builtin"; label = "convolver"; name = "convRR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 11; }; }
156 { type = "builtin"; label = "convolver"; name = "convRR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 12; }; }
157 { type = "builtin"; label = "convolver"; name = "convFC_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
158
159 # treat LFE as FC
160 { type = "builtin"; label = "convolver"; name = "convLFE_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
161 { type = "builtin"; label = "convolver"; name = "convLFE_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
162
163 # stereo output
164 { type = "builtin"; label = "mixer"; name = "mixR"; }
165 { type = "builtin"; label = "mixer"; name = "mixL"; }
166 ];
167 links = [
168 # input
169 { output = "copyFL:Out"; input="convFL_L:In"; }
170 { output = "copyFL:Out"; input="convFL_R:In"; }
171 { output = "copySL:Out"; input="convSL_L:In"; }
172 { output = "copySL:Out"; input="convSL_R:In"; }
173 { output = "copyRL:Out"; input="convRL_L:In"; }
174 { output = "copyRL:Out"; input="convRL_R:In"; }
175 { output = "copyFC:Out"; input="convFC_L:In"; }
176 { output = "copyFR:Out"; input="convFR_R:In"; }
177 { output = "copyFR:Out"; input="convFR_L:In"; }
178 { output = "copySR:Out"; input="convSR_R:In"; }
179 { output = "copySR:Out"; input="convSR_L:In"; }
180 { output = "copyRR:Out"; input="convRR_R:In"; }
181 { output = "copyRR:Out"; input="convRR_L:In"; }
182 { output = "copyFC:Out"; input="convFC_R:In"; }
183 { output = "copyLFE:Out"; input="convLFE_L:In"; }
184 { output = "copyLFE:Out"; input="convLFE_R:In"; }
185
186 # output
187 { output = "convFL_L:Out"; input="mixL:In 1"; }
188 { output = "convFL_R:Out"; input="mixR:In 1"; }
189 { output = "convSL_L:Out"; input="mixL:In 2"; }
190 { output = "convSL_R:Out"; input="mixR:In 2"; }
191 { output = "convRL_L:Out"; input="mixL:In 3"; }
192 { output = "convRL_R:Out"; input="mixR:In 3"; }
193 { output = "convFC_L:Out"; input="mixL:In 4"; }
194 { output = "convFC_R:Out"; input="mixR:In 4"; }
195 { output = "convFR_R:Out"; input="mixR:In 5"; }
196 { output = "convFR_L:Out"; input="mixL:In 5"; }
197 { output = "convSR_R:Out"; input="mixR:In 6"; }
198 { output = "convSR_L:Out"; input="mixL:In 6"; }
199 { output = "convRR_R:Out"; input="mixR:In 7"; }
200 { output = "convRR_L:Out"; input="mixL:In 7"; }
201 { output = "convLFE_R:Out"; input="mixR:In 8"; }
202 { output = "convLFE_L:Out"; input="mixL:In 8"; }
203 ];
204 inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In" "copySL:In" "copySR:In" ];
205 outputs = [ "mixL:Out" "mixR:Out" ];
206 };
207 "capture.props" = {
208 "media.class" = "Audio/Sink";
209 "audio.channels" = 8;
210 "audio.position" = [ "FL" "FR" "FC" "LFE" "RL" "RR" "SL" "SR" ];
211 };
212 "playback.props" = {
213 "node.passive" = true;
214 "audio.channels" = 2;
215 "audio.position" = [ "FL" "FR" ];
216 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000217 }
218 ];
Skyler Turner4ca71fb2022-02-20 11:12:22 +0000219 };*/
Skyler Turner205aff12021-12-20 11:22:57 +0000220 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000221 environment.etc."pipewire/7.1-surround-sound.conf".source = ./pipewire/7.1-surround-sound.conf;
Skyler Turner205aff12021-12-20 11:22:57 +0000222
Skyler Turner716da2d2022-02-20 20:40:02 +0000223 hardware.openrazer.enable = true;
224 hardware.openrazer.users = [ "minion" ];
225
Skyler Turner205aff12021-12-20 11:22:57 +0000226 # Enable touchpad support (enabled default in most desktopManager).
227 services.xserver.libinput.enable = true;
228
Skyler Turner7145c2d2022-03-08 19:19:10 +0000229 packages.dconf.enable = true;
230
Skyler Turner205aff12021-12-20 11:22:57 +0000231 # Define a user account. Don't forget to set a password with ‘passwd’.
232 users.users.minion = {
233 isNormalUser = true;
Skyler Turner8dfcf202022-02-17 17:53:35 +0000234 extraGroups = [ "wheel" "kvm" "docker" "containerd" "dialout" ]; # Enable ‘sudo’ for the user.
Skyler Turner7fe8a242022-02-06 00:42:28 +0000235 shell = pkgs.zsh;
Skyler Turner205aff12021-12-20 11:22:57 +0000236 };
237
238 # List packages installed in system profile. To search, run:
239 # $ nix search wget
Skyler Turnera3ab14b2022-01-24 11:37:41 +0000240 environment.systemPackages = with pkgs; [
Skyler Turner205aff12021-12-20 11:22:57 +0000241 vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
242 ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
243 epkgs.vterm
244 epkgs.emacsql-sqlite
245 ])) # Emacs + vterm-module (needed for vterm)
246 wget
247 firefox
248 chromium # Install chromium if needed
249 texlive.combined.scheme-full
Skyler Turner205aff12021-12-20 11:22:57 +0000250 keybase-gui
Skyler Turneree73be42022-01-10 11:02:46 +0000251 bluez
Skyler Turner1a7d0b42022-01-18 10:27:32 +0000252 macchanger
Skyler Turnerb4541be2022-01-21 19:38:55 +0000253 comic-relief
Skyler Turnerb408dcf2022-02-04 23:48:08 +0000254 qemu_kvm
Skyler Turner5954aae2022-02-06 16:03:51 +0000255 polkit_gnome
Skyler Turner785a8a62022-02-06 16:12:59 +0000256 gtk-engine-murrine
257 gtk_engines
258 gsettings-desktop-schemas
259 lxappearance
Skyler Turnerbfe0f542022-02-06 21:45:00 +0000260 ] ++ (import ./containerd/systemPackages.nix pkgs).systemPackages;
Skyler Turner205aff12021-12-20 11:22:57 +0000261
262# environment.systemPackages = [
263# import /scripts/jetbrains.rider.nix
264# ];
265
266 fonts.fonts = with pkgs; [
267 nerdfonts
268 noto-fonts
269 noto-fonts-cjk
270 noto-fonts-emoji
271 liberation_ttf
272 fira-code
273 fira-code-symbols
274 mplus-outline-fonts
275 dina-font
276 proggyfonts
277 roboto
278 ];
279
280 # Some programs need SUID wrappers, can be configured further or are
281 # started in user sessions.
282 programs.mtr.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000283 programs.kdeconnect.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000284 programs.gnupg.agent = {
285 enable = true;
286 enableSSHSupport = true;
287 };
288
289 # List services that you want to enable:
290
291 # Enable the OpenSSH daemon.
292 services.openssh.enable = true;
293 services.keybase.enable = true;
Skyler Turnera6cfb632022-01-16 23:03:43 +0000294 services.kbfs.enable = true;
295 services.kbfs.enableRedirector = true;
Skyler Turnercde828a2022-02-02 09:41:56 +0000296 security.wrappers.keybase-redirector.owner = "root";
Skyler Turnera620ae92022-02-24 08:26:31 +0000297 security.wrappers.keybase-redirector.group = "users";
Skyler Turner205aff12021-12-20 11:22:57 +0000298 services.gnome.gnome-keyring.enable = true;
299 services.i2p.enable = true;
Skyler Turner87637252022-02-01 12:28:51 +0000300 services.tlp.enable = true;
Skyler Turner32dbfb42021-12-24 15:50:22 +0000301 virtualisation.docker.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000302 virtualisation.docker.enableOnBoot = false;
Skyler Turner205aff12021-12-20 11:22:57 +0000303
Skyler Turnerfff67b52022-02-08 21:29:33 +0000304 hardware.bluetooth.enable = true;
305
Skyler Turner5954aae2022-02-06 16:03:51 +0000306 environment.pathsToLink = [ "/share/zsh" "/libexec" ];
Skyler Turner1035c8c2022-02-05 23:43:34 +0000307
Skyler Turner98483702022-02-04 23:25:21 +0000308 virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
Skyler Turner2ee83f82022-02-04 23:18:51 +0000309 virtualisation.kvmgt.enable = true;
310
Skyler Turnerff2168b2022-01-16 16:19:50 +0000311 services.openvpn.servers = {
Skyler Turner3a7d7792022-01-16 16:23:50 +0000312 clicks = { config = '' config /home/minion/Nix/secrets/clicks/client.ovpn ''; };
Skyler Turnerff2168b2022-01-16 16:19:50 +0000313 };
314
Skyler Turner4f5f11b2022-01-14 23:36:39 +0000315 nixpkgs.overlays = [
316 (self: super: {
317 polkit = super.polkit.overrideAttrs (oldAttrs: {
318 patches = oldAttrs.patches ++ [
319 (super.fetchpatch {
320 url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/716a273ce0af467968057f3e107156182bd290b0.patch";
321 sha256 = "sha256-hOJJhUmxXm87W1ZU9Y1NJ8GCyKvPjbIVtCHlhRGlN8k=";
322 })];
323 });
324 })
325 ];
326
Skyler Turnerb0362522022-02-25 09:36:23 +0000327 xdg.mime.defaultApplications = {
328 "text/html" = "chromium-browser.desktop";
329 "x-scheme-handler/http" = "chromium-browser.desktop";
330 "x-scheme-handler/https" = "chromium-browser.desktop";
331 "x-scheme-handler/about" = "chromium-browser.desktop";
332 "x-scheme-handler/unknown" = "chromium-browser.desktop";
333 };
334
Skyler Turner95f68502022-02-25 09:57:21 +0000335 # environment.sessionsVariables.DEFAULT_BROWSER = "${pkgs.chromium}/bin/chromium";
Skyler Turnerb0362522022-02-25 09:36:23 +0000336
337
Skyler Turner95f68502022-02-25 09:57:21 +0000338 boot.supportedFilesystems = [ "kbfs" ];
339
Skyler Turner205aff12021-12-20 11:22:57 +0000340 # This value determines the NixOS release from which the default
341 # settings for stateful data, like file locations and database versions
342 # on your system were taken. It‘s perfectly fine and recommended to leave
343 # this value at the release version of the first install of this system.
344 # Before changing this value read the documentation for this option
345 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
346 system.stateVersion = "21.11"; # Did you read the comment?
347
348}
349