summaryrefslogtreecommitdiff
path: root/nixos/pincer.nix
blob: a59b51f7e245c64f9a4d63f8afef6d2798a19830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ config, pkgs, hardware, ... }:

{
  imports = [
    ./configuration.nix
  ];
  networking.hostName = "pincer";

  boot.loader.systemd-boot.enable = true;
  boot.loader.timeout = 0;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.initrd.luks.devices = [
    {
      device = "/dev/sda6";
      name = "cryptroot";
      allowDiscards = true;
    }
  ];
  boot.kernelModules = ["tp_smapi" "thinkpad_acpi" "fbcon" "i915"];
  boot.extraModulePackages = [config.boot.kernelPackages.tp_smapi];
  boot.extraModprobeConfig = ''
    options iwlwifi swcrypto=1
  '';


  fileSystems = {
    "/boot" = {
      mountPoint = "/boot";
      device = "/dev/sda1";
      fsType = "vfat";
    };
    "/" = {
      mountPoint = "/";
      device = "/dev/mapper/cryptroot";
      fsType = "btrfs";
      options = ["subvol=active/nixos-root" "discard" "compress=lzo"];
    };
  };

  services.tlp.enable = true;
  services.tlp.extraConfig = ''
    # Needed for either SSD or btrfs.
    SATA_LINKPWR_ON_BAT=max_performance
  '';

  services.xserver.xkbModel = "thinkpad60";

  # The NixOS release to be compatible with for stateful data such as databases.
  system.stateVersion = "16.03";
}