|
| 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 | + |
| 7 | +{ |
| 8 | + imports = |
| 9 | + [ # Include the results of the hardware scan. |
| 10 | + "${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; rev="5a7e613703ea349fd46b3fa2f3dfe3bd5444d591"; }}/lenovo/thinkpad/x260" |
| 11 | + ./hardware-configuration.nix |
| 12 | + ./packages.nix |
| 13 | + # ./php.nix |
| 14 | + ]; |
| 15 | + |
| 16 | + # Use the GRUB 2 boot loader. |
| 17 | + # boot.loader.grub.enable = true; |
| 18 | + # boot.loader.grub.version = 2; |
| 19 | + boot.loader.systemd-boot.enable = true; |
| 20 | + # boot.loader.grub.useOSProber = true; |
| 21 | + boot.loader.efi.canTouchEfiVariables = true; |
| 22 | + # boot.loader.grub.efiSupport = true; |
| 23 | + # boot.loader.grub.efiInstallAsRemovable = true; |
| 24 | + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; |
| 25 | + # Define on which hard drive you want to install Grub. |
| 26 | + # boot.loader.grub.device = "nodev"; # or "nodev" for efi only |
| 27 | + |
| 28 | + networking.hostName = "x260"; # Define your hostname. |
| 29 | + networking.networkmanager.enable = true; # Enables wireless support via wpa_supplicant. |
| 30 | + |
| 31 | + # Set your time zone. |
| 32 | + time.timeZone = "Europe/Brussels"; |
| 33 | + |
| 34 | + # The global useDHCP flag is deprecated, therefore explicitly set to false here. |
| 35 | + # Per-interface useDHCP will be mandatory in the future, so this generated config |
| 36 | + # replicates the default behaviour. |
| 37 | + networking.useDHCP = false; |
| 38 | + # networking.interfaces.eno1.useDHCP = true; |
| 39 | + networking.interfaces.wlp4s0.useDHCP = true; |
| 40 | + |
| 41 | + # Configure network proxy if necessary |
| 42 | + # networking.proxy.default = "http://user:password@proxy:port/"; |
| 43 | + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; |
| 44 | + |
| 45 | + # Select internationalisation properties. |
| 46 | + # i18n.defaultLocale = "en_BE.UTF-8"; |
| 47 | + # console = { |
| 48 | + # font = "Lat2-Terminus16"; |
| 49 | + # keyMap = "us"; |
| 50 | + # }; |
| 51 | + |
| 52 | + # Enable the X11 windowing system. |
| 53 | + services.xserver.enable = true; |
| 54 | + |
| 55 | + services.xserver.displayManager.sddm.enable = true; |
| 56 | + services.xserver.desktopManager.plasma5.enable = true; |
| 57 | + |
| 58 | + # services.xrdp.enable = true; |
| 59 | + # services.xrdp.defaultWindowManager = "startplasma-x11"; |
| 60 | + |
| 61 | + fonts.fonts = with pkgs; [ |
| 62 | + jetbrains-mono |
| 63 | + hack-font |
| 64 | + noto-fonts |
| 65 | + noto-fonts-cjk |
| 66 | + noto-fonts-emoji |
| 67 | + liberation_ttf |
| 68 | + fira-code |
| 69 | + fira-code-symbols |
| 70 | + mplus-outline-fonts |
| 71 | + dina-font |
| 72 | + proggyfonts |
| 73 | + ]; |
| 74 | + |
| 75 | + # Configure keymap in X11 |
| 76 | + services.xserver.layout = "gb"; |
| 77 | + services.xserver.xkbOptions = "eurosign:e"; |
| 78 | + |
| 79 | + # Enable CUPS to print documents. |
| 80 | + # services.printing.enable = true; |
| 81 | + |
| 82 | + # Enable sound. |
| 83 | + #sound.enable = true; |
| 84 | + #hardware.pulseaudio.enable = true; |
| 85 | + #hardware.pulseaudio.support32Bit = true; |
| 86 | + #hardware.pulseaudio.package = pkgs.pulseaudioFull; |
| 87 | + |
| 88 | + security.rtkit.enable = true; |
| 89 | + services.pipewire = { |
| 90 | + enable = true; |
| 91 | + alsa.enable = true; |
| 92 | + alsa.support32Bit = true; |
| 93 | + pulse.enable = true; |
| 94 | + # If you want to use JACK applications, uncomment this |
| 95 | + #jack.enable = true; |
| 96 | + |
| 97 | + # use the example session manager (no others are packaged yet so this is enabled by default, |
| 98 | + # no need to redefine it in your config for now) |
| 99 | + # media-session.enable = true; |
| 100 | + }; |
| 101 | + |
| 102 | +# boot.extraModprobeConfig = '' |
| 103 | +# options snd_hda_intel enable=0,1 |
| 104 | +# ''; |
| 105 | + |
| 106 | + # Enable touchpad support (enabled default in most desktopManager). |
| 107 | + # services.xserver.libinput.enable = true; |
| 108 | + |
| 109 | + # Define a user account. Don't forget to set a password with ‘passwd’. |
| 110 | + users.users.pol = { |
| 111 | + isNormalUser = true; |
| 112 | + extraGroups = [ |
| 113 | + "wheel" |
| 114 | + "audio" |
| 115 | + "docker" |
| 116 | + "sound" |
| 117 | + "video" |
| 118 | + "networkmanager" |
| 119 | + "input" |
| 120 | + "tty" |
| 121 | + "adbusers" |
| 122 | + ]; |
| 123 | + shell = pkgs.fish; |
| 124 | + }; |
| 125 | + users.users.root.shell = pkgs.fish; |
| 126 | + security.sudo.wheelNeedsPassword = false; # Use 'sudo' without a password |
| 127 | + |
| 128 | + programs.fish.shellAliases = { |
| 129 | + cat = "bat"; |
| 130 | + ls = "exa"; |
| 131 | + }; |
| 132 | + |
| 133 | + nixpkgs.config.allowUnfree = true; |
| 134 | + |
| 135 | + # Nix Garbage Collector |
| 136 | + nix.gc = { |
| 137 | + automatic = true; |
| 138 | + dates = "weekly"; |
| 139 | + options = "--delete-older-than 10d"; |
| 140 | + }; |
| 141 | + |
| 142 | + powerManagement.enable = true; |
| 143 | + |
| 144 | + programs.browserpass.enable = true; |
| 145 | + # Some programs need SUID wrappers, can be configured further or are |
| 146 | + # started in user sessions. |
| 147 | + # programs.mtr.enable = true; |
| 148 | + programs.gnupg.agent = { |
| 149 | + enable = true; |
| 150 | + enableSSHSupport = true; |
| 151 | + }; |
| 152 | + |
| 153 | + programs.fish.enable = true; |
| 154 | + programs.fish.promptInit = '' |
| 155 | + any-nix-shell fish --info-right | source |
| 156 | + ''; |
| 157 | + |
| 158 | + # List services that you want to enable: |
| 159 | + services.cron = { |
| 160 | + enable = true; |
| 161 | + systemCronJobs = [ |
| 162 | + "0 * * * * root nix-channel --update" |
| 163 | + ]; |
| 164 | + }; |
| 165 | + # Enable the OpenSSH daemon. |
| 166 | + services.openssh.enable = false; |
| 167 | + |
| 168 | + networking.firewall.allowedTCPPorts = [ 3389 ]; |
| 169 | + networking.firewall.checkReversePath = false; |
| 170 | + # Open ports in the firewall. |
| 171 | + # networking.firewall.allowedTCPPorts = [ ... ]; |
| 172 | + # networking.firewall.allowedUDPPorts = [ ... ]; |
| 173 | + # Or disable the firewall altogether. |
| 174 | + # networking.firewall.enable = false; |
| 175 | + |
| 176 | + # This value determines the NixOS release from which the default |
| 177 | + # settings for stateful data, like file locations and database versions |
| 178 | + # on your system were taken. It‘s perfectly fine and recommended to leave |
| 179 | + # this value at the release version of the first install of this system. |
| 180 | + # Before changing this value read the documentation for this option |
| 181 | + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). |
| 182 | + system.stateVersion = "21.05"; # Did you read the comment? |
| 183 | + |
| 184 | + system.autoUpgrade = { |
| 185 | + enable = true; |
| 186 | + allowReboot = true; |
| 187 | + }; |
| 188 | + |
| 189 | + environment.etc."current-system-packages".text = with lib; |
| 190 | + let |
| 191 | + packages = builtins.map (p: "${p.name}") config.environment.systemPackages; |
| 192 | + sortedUnique = builtins.sort builtins.lessThan (lib.unique packages); |
| 193 | + formatted = builtins.concatStringsSep "\n" sortedUnique; |
| 194 | + in |
| 195 | + formatted; |
| 196 | + |
| 197 | +# system.copySystemConfiguration = true; |
| 198 | + |
| 199 | + services.fwupd.enable = true; |
| 200 | + |
| 201 | + virtualisation.docker.enable = true; |
| 202 | + |
| 203 | + hardware.bluetooth.enable = true; |
| 204 | + |
| 205 | + programs.adb.enable = true; |
| 206 | + |
| 207 | + services.flatpak.enable = true; |
| 208 | + |
| 209 | + networking.extraHosts = |
| 210 | + '' |
| 211 | + 127.0.0.1 collabora |
| 212 | + 127.0.0.1 onlyoffice |
| 213 | + 127.0.0.1 web |
| 214 | + ''; |
| 215 | + |
| 216 | + boot.kernel.sysctl = { |
| 217 | + "networking.enableIPv6" = false; |
| 218 | + "net.ipv6.conf.wlp4s0.disable_ipv6" = true; |
| 219 | + }; |
| 220 | + |
| 221 | + # networking.resolvconf.dnsExtensionMechanism = false; |
| 222 | + |
| 223 | + nix = { |
| 224 | + extraOptions = '' |
| 225 | + experimental-features = nix-command flakes |
| 226 | + ''; |
| 227 | + }; |
| 228 | +} |
0 commit comments