summaryrefslogtreecommitdiffstats
path: root/lass/1systems/hilum/physical.nix
blob: f97873aa958573a5a05291f32dbd164aa91395f5 (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
{ config, lib, pkgs, ... }:

{
  imports = [
    ./config.nix
    <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
    {
      # nice hack to carry around state passed impurely at the beginning
      options.mainDisk = lib.mkOption {
        type = lib.types.str;
        default = builtins.readFile "/etc/hilum-disk";
      };
      config.environment.etc.hilum-disk.text = config.mainDisk;
    }
    {
      options.luksPassFile = lib.mkOption {
        type = lib.types.nullOr lib.types.str;
        default = null;
      };
    }
  ];

  disko.devices = import ./disk.nix {
    inherit lib;
    disk = config.mainDisk;
    keyFile = config.luksPassFile;
  };

  boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
  boot.initrd.kernelModules = [ "dm-snapshot" ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  boot.loader.grub.enable = true;
  boot.loader.grub.efiSupport = true;
  boot.loader.grub.device = config.mainDisk;
  boot.loader.grub.efiInstallAsRemovable = true;

  swapDevices = [ ];

  nix.maxJobs = lib.mkDefault 4;
  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}