blob: 6bb62f02f5532072ac4e918b81b65fb46df0b5ee [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 Turnerf0e4f3e2022-01-09 13:46:00 +000053 # displayManager.startx.enable = true;
54 displayManager.sddm.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +000055 };
56
57 # And wayland
58 programs.sway = {
59 enable = true;
60 wrapperFeatures.gtk = true; # so that gtk works properly
61 extraPackages = with pkgs; [
62 swaylock
63 swayidle
64 wl-clipboard
65 mako # notification daemon
66 alacritty # Alacritty is the default terminal in the config
Skyler Turner205aff12021-12-20 11:22:57 +000067 ];
68 };
69
Skyler Turneref649b02022-02-06 16:05:24 +000070 programs.qt5ct.enable = true;
Skyler Turnere24f21c2022-02-06 16:02:53 +000071 programs.waybar.enable = false; # true;
72
Skyler Turner205aff12021-12-20 11:22:57 +000073 # Get screensharing to work
74 xdg = {
75 portal = {
76 enable = true;
77 extraPortals = with pkgs; [
78 xdg-desktop-portal-wlr
79 xdg-desktop-portal-gtk
80 ];
81 gtkUsePortal = true;
Skyler Turner84ec77c2022-01-14 09:05:57 +000082 wlr.enable = true;
83
Skyler Turner205aff12021-12-20 11:22:57 +000084 };
85 };
86
87 # Configure keymap in X11
88 services.xserver.layout = "gb";
89 # services.xserver.xkbOptions = "eurosign:e";
90
91
92 # Permit and install steam
93 nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
94 "steam"
95 "steam-original"
96 "steam-runtime"
97 ];
98
99 programs.steam.enable = true;
100
101
102 # Enable CUPS to print documents.
103 services.printing.enable = true;
104
105 # Enable sound.
106 sound.enable = true;
107 hardware.pulseaudio.enable = false;
108 services.pipewire = {
109 enable = true;
110 alsa = {
111 enable = true;
112 support32Bit = true;
113 };
114 pulse.enable = true;
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000115 config.pipewire = {
Skyler Turner074765b2022-02-20 10:46:58 +0000116 "context.modules" = [
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000117 {
Skyler Turner074765b2022-02-20 10:46:58 +0000118 name = "libpipewire-module-filter-chain";
119 args = {
120 "node.name" = "effect_output.virtual-surround-7.1-hesuvi";
121 "node.description" = "Virtual Surround Sink";
122 "media.name" = "Virtual Surround Sink";
123 nodes = [
124 # duplicate inputs
125 { type = "builtin"; label = "copy"; name = "copyFL"; }
126 { type = "builtin"; label = "copy"; name = "copyFR"; }
127 { type = "builtin"; label = "copy"; name = "copyFC"; }
128 { type = "builtin"; label = "copy"; name = "copyRL"; }
129 { type = "builtin"; label = "copy"; name = "copyRR"; }
130 { type = "builtin"; label = "copy"; name = "copySL"; }
131 { type = "builtin"; label = "copy"; name = "copySR"; }
132 { type = "builtin"; label = "copy"; name = "copyLFE"; }
133
134 # apply hrir - HeSuVi 14-channel WAV (not the *-.wav variants) (note: */44/* in HeSuVi are the same, but resampled to 44100)
135 { type = "builtin"; label = "convolver"; name = "convFL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 0; }; }
136 { type = "builtin"; label = "convolver"; name = "convFL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 1; }; }
137 { type = "builtin"; label = "convolver"; name = "convSL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 2; }; }
138 { type = "builtin"; label = "convolver"; name = "convSL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 3; }; }
139 { type = "builtin"; label = "convolver"; name = "convRL_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 4; }; }
140 { type = "builtin"; label = "convolver"; name = "convRL_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 5; }; }
141 { type = "builtin"; label = "convolver"; name = "convFC_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
142 { type = "builtin"; label = "convolver"; name = "convFR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 7; }; }
143 { type = "builtin"; label = "convolver"; name = "convFR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 8; }; }
144 { type = "builtin"; label = "convolver"; name = "convSR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 9; }; }
145 { type = "builtin"; label = "convolver"; name = "convSR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 10; }; }
146 { type = "builtin"; label = "convolver"; name = "convRR_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 11; }; }
147 { type = "builtin"; label = "convolver"; name = "convRR_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 12; }; }
148 { type = "builtin"; label = "convolver"; name = "convFC_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
149
150 # treat LFE as FC
151 { type = "builtin"; label = "convolver"; name = "convLFE_R"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 13; }; }
152 { type = "builtin"; label = "convolver"; name = "convLFE_L"; config = { filename = "hrir_hesuvi/hrir.wav"; channel = 6; }; }
153
154 # stereo output
155 { type = "builtin"; label = "mixer"; name = "mixR"; }
156 { type = "builtin"; label = "mixer"; name = "mixL"; }
157 ];
158 links = [
159 # input
160 { output = "copyFL:Out"; input="convFL_L:In"; }
161 { output = "copyFL:Out"; input="convFL_R:In"; }
162 { output = "copySL:Out"; input="convSL_L:In"; }
163 { output = "copySL:Out"; input="convSL_R:In"; }
164 { output = "copyRL:Out"; input="convRL_L:In"; }
165 { output = "copyRL:Out"; input="convRL_R:In"; }
166 { output = "copyFC:Out"; input="convFC_L:In"; }
167 { output = "copyFR:Out"; input="convFR_R:In"; }
168 { output = "copyFR:Out"; input="convFR_L:In"; }
169 { output = "copySR:Out"; input="convSR_R:In"; }
170 { output = "copySR:Out"; input="convSR_L:In"; }
171 { output = "copyRR:Out"; input="convRR_R:In"; }
172 { output = "copyRR:Out"; input="convRR_L:In"; }
173 { output = "copyFC:Out"; input="convFC_R:In"; }
174 { output = "copyLFE:Out"; input="convLFE_L:In"; }
175 { output = "copyLFE:Out"; input="convLFE_R:In"; }
176
177 # output
178 { output = "convFL_L:Out"; input="mixL:In 1"; }
179 { output = "convFL_R:Out"; input="mixR:In 1"; }
180 { output = "convSL_L:Out"; input="mixL:In 2"; }
181 { output = "convSL_R:Out"; input="mixR:In 2"; }
182 { output = "convRL_L:Out"; input="mixL:In 3"; }
183 { output = "convRL_R:Out"; input="mixR:In 3"; }
184 { output = "convFC_L:Out"; input="mixL:In 4"; }
185 { output = "convFC_R:Out"; input="mixR:In 4"; }
186 { output = "convFR_R:Out"; input="mixR:In 5"; }
187 { output = "convFR_L:Out"; input="mixL:In 5"; }
188 { output = "convSR_R:Out"; input="mixR:In 6"; }
189 { output = "convSR_L:Out"; input="mixL:In 6"; }
190 { output = "convRR_R:Out"; input="mixR:In 7"; }
191 { output = "convRR_L:Out"; input="mixL:In 7"; }
192 { output = "convLFE_R:Out"; input="mixR:In 8"; }
193 { output = "convLFE_L:Out"; input="mixL:In 8"; }
194 ];
195 inputs = [ "copyFL:In" "copyFR:In" "copyFC:In" "copyLFE:In" "copyRL:In" "copyRR:In" "copySL:In" "copySR:In" ];
196 outputs = [ "mixL:Out" "mixR:Out" ];
197 };
198 "capture.props" = {
199 "media.class" = "Audio/Sink";
200 "audio.channels" = 8;
201 "audio.position" = [ "FL" "FR" "FC" "LFE" "RL" "RR" "SL" "SR" ];
202 };
203 "playback.props" = {
204 "node.passive" = true;
205 "audio.channels" = 2;
206 "audio.position" = [ "FL" "FR" ];
207 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000208 }
209 ];
210 };
Skyler Turner205aff12021-12-20 11:22:57 +0000211 };
Skyler Turner2f6b3ed2022-02-19 14:37:14 +0000212 environment.etc."pipewire/7.1-surround-sound.conf".source = ./pipewire/7.1-surround-sound.conf;
Skyler Turner205aff12021-12-20 11:22:57 +0000213
214 # Enable touchpad support (enabled default in most desktopManager).
215 services.xserver.libinput.enable = true;
216
217 # Define a user account. Don't forget to set a password with ‘passwd’.
218 users.users.minion = {
219 isNormalUser = true;
Skyler Turner8dfcf202022-02-17 17:53:35 +0000220 extraGroups = [ "wheel" "kvm" "docker" "containerd" "dialout" ]; # Enable ‘sudo’ for the user.
Skyler Turner7fe8a242022-02-06 00:42:28 +0000221 shell = pkgs.zsh;
Skyler Turner205aff12021-12-20 11:22:57 +0000222 };
223
224 # List packages installed in system profile. To search, run:
225 # $ nix search wget
Skyler Turnera3ab14b2022-01-24 11:37:41 +0000226 environment.systemPackages = with pkgs; [
Skyler Turner205aff12021-12-20 11:22:57 +0000227 vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
228 ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [
229 epkgs.vterm
230 epkgs.emacsql-sqlite
231 ])) # Emacs + vterm-module (needed for vterm)
232 wget
233 firefox
234 chromium # Install chromium if needed
235 texlive.combined.scheme-full
Skyler Turner205aff12021-12-20 11:22:57 +0000236 keybase-gui
Skyler Turneree73be42022-01-10 11:02:46 +0000237 bluez
Skyler Turner1a7d0b42022-01-18 10:27:32 +0000238 macchanger
Skyler Turnerb4541be2022-01-21 19:38:55 +0000239 comic-relief
Skyler Turnerb408dcf2022-02-04 23:48:08 +0000240 qemu_kvm
Skyler Turner5954aae2022-02-06 16:03:51 +0000241 polkit_gnome
Skyler Turner785a8a62022-02-06 16:12:59 +0000242 gtk-engine-murrine
243 gtk_engines
244 gsettings-desktop-schemas
245 lxappearance
Skyler Turnerbfe0f542022-02-06 21:45:00 +0000246 ] ++ (import ./containerd/systemPackages.nix pkgs).systemPackages;
Skyler Turner205aff12021-12-20 11:22:57 +0000247
248# environment.systemPackages = [
249# import /scripts/jetbrains.rider.nix
250# ];
251
252 fonts.fonts = with pkgs; [
253 nerdfonts
254 noto-fonts
255 noto-fonts-cjk
256 noto-fonts-emoji
257 liberation_ttf
258 fira-code
259 fira-code-symbols
260 mplus-outline-fonts
261 dina-font
262 proggyfonts
263 roboto
264 ];
265
266 # Some programs need SUID wrappers, can be configured further or are
267 # started in user sessions.
268 programs.mtr.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000269 programs.kdeconnect.enable = true;
Skyler Turner205aff12021-12-20 11:22:57 +0000270 programs.gnupg.agent = {
271 enable = true;
272 enableSSHSupport = true;
273 };
274
275 # List services that you want to enable:
276
277 # Enable the OpenSSH daemon.
278 services.openssh.enable = true;
279 services.keybase.enable = true;
Skyler Turnera6cfb632022-01-16 23:03:43 +0000280 services.kbfs.enable = true;
281 services.kbfs.enableRedirector = true;
Skyler Turnercde828a2022-02-02 09:41:56 +0000282 security.wrappers.keybase-redirector.owner = "root";
283 security.wrappers.keybase-redirector.group = "root";
Skyler Turner205aff12021-12-20 11:22:57 +0000284 services.gnome.gnome-keyring.enable = true;
285 services.i2p.enable = true;
Skyler Turner87637252022-02-01 12:28:51 +0000286 services.tlp.enable = true;
Skyler Turner32dbfb42021-12-24 15:50:22 +0000287 virtualisation.docker.enable = true;
Skyler Turnerf2a29ee2022-02-05 23:39:37 +0000288 virtualisation.docker.enableOnBoot = false;
Skyler Turner205aff12021-12-20 11:22:57 +0000289
Skyler Turnerfff67b52022-02-08 21:29:33 +0000290 hardware.bluetooth.enable = true;
291
Skyler Turner5954aae2022-02-06 16:03:51 +0000292 environment.pathsToLink = [ "/share/zsh" "/libexec" ];
Skyler Turner1035c8c2022-02-05 23:43:34 +0000293
Skyler Turner98483702022-02-04 23:25:21 +0000294 virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
Skyler Turner2ee83f82022-02-04 23:18:51 +0000295 virtualisation.kvmgt.enable = true;
296
Skyler Turnerff2168b2022-01-16 16:19:50 +0000297 services.openvpn.servers = {
Skyler Turner3a7d7792022-01-16 16:23:50 +0000298 clicks = { config = '' config /home/minion/Nix/secrets/clicks/client.ovpn ''; };
Skyler Turnerff2168b2022-01-16 16:19:50 +0000299 };
300
Skyler Turner4f5f11b2022-01-14 23:36:39 +0000301 nixpkgs.overlays = [
302 (self: super: {
303 polkit = super.polkit.overrideAttrs (oldAttrs: {
304 patches = oldAttrs.patches ++ [
305 (super.fetchpatch {
306 url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/716a273ce0af467968057f3e107156182bd290b0.patch";
307 sha256 = "sha256-hOJJhUmxXm87W1ZU9Y1NJ8GCyKvPjbIVtCHlhRGlN8k=";
308 })];
309 });
310 })
311 ];
312
Skyler Turner205aff12021-12-20 11:22:57 +0000313 # This value determines the NixOS release from which the default
314 # settings for stateful data, like file locations and database versions
315 # on your system were taken. It‘s perfectly fine and recommended to leave
316 # this value at the release version of the first install of this system.
317 # Before changing this value read the documentation for this option
318 # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
319 system.stateVersion = "21.11"; # Did you read the comment?
320
321}
322