Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 1 | # 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 Turner | 0872be9 | 2022-01-24 11:31:38 +0000 | [diff] [blame] | 7 | { |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 8 | imports = |
| 9 | [ # Include the results of the hardware scan. |
| 10 | ./hardware-configuration.nix |
Skyler Turner | 444ffc2 | 2021-12-20 11:28:06 +0000 | [diff] [blame] | 11 | ../secrets/networking-configuration.nix |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 12 | ./packaging-configuration.nix |
Skyler Turner | 657b049 | 2022-02-06 21:42:02 +0000 | [diff] [blame] | 13 | ./containerd/containerd.nix |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 14 | ]; |
| 15 | |
Skyler Turner | 32dbfb4 | 2021-12-24 15:50:22 +0000 | [diff] [blame] | 16 | # Prepare nix flakes |
| 17 | nix = { |
| 18 | package = pkgs.nixFlakes; |
| 19 | extraOptions = '' |
| 20 | experimental-features = nix-command flakes |
| 21 | ''; |
| 22 | }; |
| 23 | |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 24 | # 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 Turner | 7b0051e | 2021-12-29 15:46:56 +0000 | [diff] [blame] | 29 | # Enable emulated systems |
Skyler Turner | 107ae41 | 2021-12-29 18:34:59 +0000 | [diff] [blame] | 30 | boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv6l-linux" ]; |
Skyler Turner | 7b0051e | 2021-12-29 15:46:56 +0000 | [diff] [blame] | 31 | |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 32 | # 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 Turner | f0e4f3e | 2022-01-09 13:46:00 +0000 | [diff] [blame] | 53 | # displayManager.startx.enable = true; |
| 54 | displayManager.sddm.enable = true; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 55 | }; |
| 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 Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 67 | ]; |
| 68 | }; |
| 69 | |
Skyler Turner | ef649b0 | 2022-02-06 16:05:24 +0000 | [diff] [blame] | 70 | programs.qt5ct.enable = true; |
Skyler Turner | e24f21c | 2022-02-06 16:02:53 +0000 | [diff] [blame] | 71 | programs.waybar.enable = false; # true; |
| 72 | |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 73 | # 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 Turner | 84ec77c | 2022-01-14 09:05:57 +0000 | [diff] [blame] | 82 | wlr.enable = true; |
| 83 | |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 84 | }; |
| 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; |
| 115 | }; |
| 116 | |
| 117 | # Enable touchpad support (enabled default in most desktopManager). |
| 118 | services.xserver.libinput.enable = true; |
| 119 | |
| 120 | # Define a user account. Don't forget to set a password with ‘passwd’. |
| 121 | users.users.minion = { |
| 122 | isNormalUser = true; |
Skyler Turner | 2ee83f8 | 2022-02-04 23:18:51 +0000 | [diff] [blame] | 123 | extraGroups = [ "wheel" "kvm" "docker" "containerd" ]; # Enable ‘sudo’ for the user. |
Skyler Turner | 7fe8a24 | 2022-02-06 00:42:28 +0000 | [diff] [blame] | 124 | shell = pkgs.zsh; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 125 | }; |
| 126 | |
| 127 | # List packages installed in system profile. To search, run: |
| 128 | # $ nix search wget |
Skyler Turner | a3ab14b | 2022-01-24 11:37:41 +0000 | [diff] [blame] | 129 | environment.systemPackages = with pkgs; [ |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 130 | vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. |
| 131 | ((emacsPackagesNgGen emacs).emacsWithPackages (epkgs: [ |
| 132 | epkgs.vterm |
| 133 | epkgs.emacsql-sqlite |
| 134 | ])) # Emacs + vterm-module (needed for vterm) |
| 135 | wget |
| 136 | firefox |
| 137 | chromium # Install chromium if needed |
| 138 | texlive.combined.scheme-full |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 139 | keybase-gui |
Skyler Turner | ee73be4 | 2022-01-10 11:02:46 +0000 | [diff] [blame] | 140 | bluez |
Skyler Turner | 1a7d0b4 | 2022-01-18 10:27:32 +0000 | [diff] [blame] | 141 | macchanger |
Skyler Turner | b4541be | 2022-01-21 19:38:55 +0000 | [diff] [blame] | 142 | comic-relief |
Skyler Turner | b408dcf | 2022-02-04 23:48:08 +0000 | [diff] [blame] | 143 | qemu_kvm |
Skyler Turner | 5954aae | 2022-02-06 16:03:51 +0000 | [diff] [blame] | 144 | polkit_gnome |
Skyler Turner | 785a8a6 | 2022-02-06 16:12:59 +0000 | [diff] [blame] | 145 | gtk-engine-murrine |
| 146 | gtk_engines |
| 147 | gsettings-desktop-schemas |
| 148 | lxappearance |
Skyler Turner | bfe0f54 | 2022-02-06 21:45:00 +0000 | [diff] [blame] | 149 | ] ++ (import ./containerd/systemPackages.nix pkgs).systemPackages; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 150 | |
| 151 | # environment.systemPackages = [ |
| 152 | # import /scripts/jetbrains.rider.nix |
| 153 | # ]; |
| 154 | |
| 155 | fonts.fonts = with pkgs; [ |
| 156 | nerdfonts |
| 157 | noto-fonts |
| 158 | noto-fonts-cjk |
| 159 | noto-fonts-emoji |
| 160 | liberation_ttf |
| 161 | fira-code |
| 162 | fira-code-symbols |
| 163 | mplus-outline-fonts |
| 164 | dina-font |
| 165 | proggyfonts |
| 166 | roboto |
| 167 | ]; |
| 168 | |
| 169 | # Some programs need SUID wrappers, can be configured further or are |
| 170 | # started in user sessions. |
| 171 | programs.mtr.enable = true; |
Skyler Turner | f2a29ee | 2022-02-05 23:39:37 +0000 | [diff] [blame] | 172 | programs.kdeconnect.enable = true; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 173 | programs.gnupg.agent = { |
| 174 | enable = true; |
| 175 | enableSSHSupport = true; |
| 176 | }; |
| 177 | |
| 178 | # List services that you want to enable: |
| 179 | |
| 180 | # Enable the OpenSSH daemon. |
| 181 | services.openssh.enable = true; |
| 182 | services.keybase.enable = true; |
Skyler Turner | a6cfb63 | 2022-01-16 23:03:43 +0000 | [diff] [blame] | 183 | services.kbfs.enable = true; |
| 184 | services.kbfs.enableRedirector = true; |
Skyler Turner | cde828a | 2022-02-02 09:41:56 +0000 | [diff] [blame] | 185 | security.wrappers.keybase-redirector.owner = "root"; |
| 186 | security.wrappers.keybase-redirector.group = "root"; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 187 | services.gnome.gnome-keyring.enable = true; |
| 188 | services.i2p.enable = true; |
Skyler Turner | 8763725 | 2022-02-01 12:28:51 +0000 | [diff] [blame] | 189 | services.tlp.enable = true; |
Skyler Turner | 32dbfb4 | 2021-12-24 15:50:22 +0000 | [diff] [blame] | 190 | virtualisation.docker.enable = true; |
Skyler Turner | f2a29ee | 2022-02-05 23:39:37 +0000 | [diff] [blame] | 191 | virtualisation.docker.enableOnBoot = false; |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 192 | |
Skyler Turner | 5954aae | 2022-02-06 16:03:51 +0000 | [diff] [blame] | 193 | environment.pathsToLink = [ "/share/zsh" "/libexec" ]; |
Skyler Turner | 1035c8c | 2022-02-05 23:43:34 +0000 | [diff] [blame] | 194 | |
Skyler Turner | 9848370 | 2022-02-04 23:25:21 +0000 | [diff] [blame] | 195 | virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; |
Skyler Turner | 2ee83f8 | 2022-02-04 23:18:51 +0000 | [diff] [blame] | 196 | virtualisation.kvmgt.enable = true; |
| 197 | |
Skyler Turner | ff2168b | 2022-01-16 16:19:50 +0000 | [diff] [blame] | 198 | services.openvpn.servers = { |
Skyler Turner | 3a7d779 | 2022-01-16 16:23:50 +0000 | [diff] [blame] | 199 | clicks = { config = '' config /home/minion/Nix/secrets/clicks/client.ovpn ''; }; |
Skyler Turner | ff2168b | 2022-01-16 16:19:50 +0000 | [diff] [blame] | 200 | }; |
| 201 | |
Skyler Turner | 4f5f11b | 2022-01-14 23:36:39 +0000 | [diff] [blame] | 202 | nixpkgs.overlays = [ |
| 203 | (self: super: { |
| 204 | polkit = super.polkit.overrideAttrs (oldAttrs: { |
| 205 | patches = oldAttrs.patches ++ [ |
| 206 | (super.fetchpatch { |
| 207 | url = "https://gitlab.freedesktop.org/polkit/polkit/-/commit/716a273ce0af467968057f3e107156182bd290b0.patch"; |
| 208 | sha256 = "sha256-hOJJhUmxXm87W1ZU9Y1NJ8GCyKvPjbIVtCHlhRGlN8k="; |
| 209 | })]; |
| 210 | }); |
| 211 | }) |
| 212 | ]; |
| 213 | |
Skyler Turner | 205aff1 | 2021-12-20 11:22:57 +0000 | [diff] [blame] | 214 | # This value determines the NixOS release from which the default |
| 215 | # settings for stateful data, like file locations and database versions |
| 216 | # on your system were taken. It‘s perfectly fine and recommended to leave |
| 217 | # this value at the release version of the first install of this system. |
| 218 | # Before changing this value read the documentation for this option |
| 219 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). |
| 220 | system.stateVersion = "21.11"; # Did you read the comment? |
| 221 | |
| 222 | } |
| 223 | |