summary refs log tree commit diff
path: root/machines/fourmi/devices.nix
blob: 37385532e097e8e6b4a27f383e6f65bfcc35385b (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
{ lib, nixos-hardware, ... }:

{
  # correctly configure hardware in this pi server.
  imports = [
    nixos-hardware.nixosModules.raspberry-pi-4
  ];

  # boot settings
  boot = {
    loader = { 
      grub.enable = false;
      generic-extlinux-compatible.enable = true;
    };

    kernelModules = [ "wireguard" ];
  };

  # apply rpi4-specific device tree from nixos-hardware.
  hardware = {
    raspberry-pi."4".apply-overlays-dtmerge.enable = true;
    deviceTree = {
      enable = true;
      filter = "*rpi-4-*.dtb";
    };
  };

  networking = {
    # todo: configure properly
    firewall.enable = lib.mkForce false;

    useDHCP = true;
    networkmanager = {
      enable = false;
      wifi.powersave = false;
    };
  };
}