about summary refs log tree commit diff
path: root/users/flokli/ipu6-softisp/default.nix
blob: 1f603dbb42833e5a8b660abb1e229949d3866b30 (plain) (blame)
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
# This file ensures the fixes from ./config.nix build with the version of
# nixpkgs from depot.
# If you're an outside user of this, import config.nix as a NixOS module (and
# check the README.md file).

{ depot
, pkgs
, ...
}:

let
  systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
in
depot.nix.readTree.drvTargets rec {
  testSystem = systemFor ({ modulesPath, pkgs, ... }: {
    imports = [
      # Import the module, this is something a user would do in their config.
      ./config.nix
    ];

    # Make sure we use the linuxPackages_latest.
    boot.kernelPackages = pkgs.linuxPackages_latest;

    # Enable firmware.
    hardware.enableAllFirmware = true;

    # Set some options necessary to evaluate.
    boot.loader.systemd-boot.enable = true;
    fileSystems."/" = {
      device = "/dev/disk/by-partlabel/root";
      fsType = "xfs";
    };

    # Enable pipewire and wireplumber.
    services.pipewire = {
      enable = true;
      wireplumber.enable = true;
    };

    # Shut off the warning.
    system.stateVersion = "24.05";
  });

  # Make sure the firmware requested by the driver is present in our firmware.
  # We do have a .xz suffix here, but that's fine, since request_firmware does
  # check ${name}.xz too in case CONFIG_FW_LOADER_COMPRESS is set.
  # The path needs to be kept in sync with the ones used in the kernel patch.
  checkFirmware = pkgs.runCommand "check-firmware" { } ''
    stat ${testSystem}/firmware/intel/ipu/ipu6se_fw.bin.xz
    stat ${testSystem}/firmware/intel/ipu/ipu6ep_fw.bin.xz
    stat ${testSystem}/firmware/intel/ipu/ipu6_fw.bin.xz
    stat ${testSystem}/firmware/intel/ipu/ipu6epmtl_fw.bin.xz

    # all good, succeed build
    touch $out
  '';
}