summaryrefslogtreecommitdiff
path: root/machines/x220-aji.nix
blob: b05f16ab4276df0e156f53332fbf3d5a25db78e6 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ config, lib, pkgs, ... }:
{
  imports = [
    ../config/desktop.nix
    ../config/laptop.nix
    ../config/thinkpad.nix
    ../config/yubikey.nix
    ../config/postgresql.nix
    # ../config/ap.nix
    ../config/pjournal.nix
  ];

  services.pjournal.enable = true;

  services.thinkfan.enable = true;
  services.thinkfan.sensors = ''
    hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp1_input
    hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp2_input
    hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon4/temp3_input
  '';
  services.openssh.enable = true;
  services.postgresql.package = lib.mkForce pkgs.postgresql_11;

  nixpkgs.config.allowUnfree = true;
  nixpkgs.config.packageOverrides = pkgs: {
    my-steam-run = (pkgs.steam.override {
      extraPkgs = pkgs: [ ];
    }).run;
  };

  environment.systemPackages = with pkgs; [
    # my-steam-run
    # wine
  ];

  networking = {
    hostName = "aji";
  };

  boot = {
    initrd.luks.devices = {
      cryptroot = {
        device = "/dev/disk/by-id/ata-INTEL_SSDSC2BW240H6_CVTR609508W0240CGN-part2";
        allowDiscards = true;
      };
    };

    extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];

    extraModprobeConfig = ''
      options i915 enable_rc6=1
      options thinkpad_acpi fan_control=1
    '';
  };

  fileSystems = {
    "/boot" = lib.mkForce {
      mountPoint = "/boot";
      device = "/dev/disk/by-uuid/829B-F56C";
      fsType = "vfat";
    };
    "/" = {
      mountPoint = "/";
      device = "/dev/mapper/cryptvg-root";
      fsType = "btrfs";
      options = ["subvol=aji-root" "discard" "compress=lzo"];
    };
    "/btrfs" = {
      mountPoint = "/btrfs";
      device = "/dev/mapper/cryptvg-root";
      fsType = "btrfs";
      options = ["discard" "compress=lzo"];
    };
  };
  swapDevices =
    [ { device = "/dev/mapper/cryptvg-swap"; }
    ];
  system.stateVersion = "17.04";
}