~sumner/nixos-configuration

ref: 7e558d0d52b4201b2e0b7de2eb1a2d75fab02a2e nixos-configuration/host-configurations/mustafar/default.nix -rw-r--r-- 2.6 KiB
7e558d0dSumner Evans matrix-synapse: email config for nevarro 9 months ago
                                                                                
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{ lib, pkgs, ... }: with pkgs; let
  sof-firmware = callPackage ./intel-sof-firmware.nix {};
in
{
  # Set the hostname
  networking.hostName = "mustafar";
  hardware.isPC = true;
  hardware.ramSize = 8;
  hardware.isLaptop = true;
  wayland.enable = true;

  nixpkgs.overlays = [
    # sof-firmware so sleep works on Kohaku
    (
      self: super: {
        sof-firmware = super.sof-firmware.overrideAttrs (
          old: rec {
            version = "1.5.1";
            src = super.fetchFromGitHub {
              owner = "thesofproject";
              repo = "sof-bin";
              rev = "ae61d2778b0a0f47461a52da0d1f191f651e0763";
              sha256 = "0j6bpwz49skvdvian46valjw4anwlrnkq703n0snkbngmq78prba";
            };

            installPhase = ''
              mkdir -p $out/lib/firmware/intel
              sed -i 's/ROOT=.*$/ROOT=$out/g' go.sh
              sed -i 's/VERSION=.*$/VERSION=v${version}/g' go.sh
              ./go.sh
            '';
          }
        );
      }
    )
  ];
  nix.enableRemoteBuildOnCoruscant = true;

  virtualisation.docker.enable = true;

  # Get sound working
  # hardware.firmware = [ sof-firmware ];
  hardware.enableAllFirmware = true;
  hardware.enableRedistributableFirmware = true;
  boot.blacklistedKernelModules = [ "snd_hda_intel" "snd_soc_skl" ];

  # Use systemd-boot
  boot.loader.systemd-boot.enable = true;
  boot.kernelPackages = linuxPackages_5_10;
  boot.kernelPatches = [
    {
      name = "chromebook-config";
      patch = null;
      extraConfig = ''
        CHROMEOS_LAPTOP m
        CHROMEOS_PSTORE m
        CHROME_PLATFORMS y
        CROS_EC m
        CROS_EC_CHARDEV m
        CROS_EC_DEBUGFS m
        CROS_EC_I2C m
        CROS_EC_LPC m
        CROS_EC_SENSORHUB m
        CROS_EC_SPI m
        CROS_EC_SYSFS m
        CROS_EC_TYPEC m
        CROS_USBPD_LOGGER m
        EXTCON_USBC_CROS_EC m
        I2C_CROS_EC_TUNNEL m
        IIO_CROS_EC_ACCEL_LEGACY m
        IIO_CROS_EC_BARO m
        IIO_CROS_EC_LIGHT_PROX m
        IIO_CROS_EC_SENSORS m
        IIO_CROS_EC_SENSORS_CORE m
        IIO_CROS_EC_SENSORS_LID_ANGLE m
        KEYBOARD_CROS_EC m
        RTC_DRV_CROS_EC m
        SND_SOC_CROS_EC_CODEC m
      '';
    }
  ];

  # Orientation and ambient light
  hardware.sensor.iio.enable = true;

  # Set up networking.
  networking.interfaces.wlp0s20f3.useDHCP = true;

  # high-resolution display
  hardware.video.hidpi.enable = lib.mkDefault true;

  # Intel's libva driver
  hardware.opengl.extraPackages = [
    intel-media-driver
    vaapiVdpau
    libvdpau-va-gl
    intel-ocl
  ];
  environment.systemPackages = [ libva-utils ];
}