summaryrefslogtreecommitdiffstats
path: root/lass/1systems/prism/physical.nix
blob: d4dd883828515d7e1b4514f91fdfa893ab17ca6e (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ config, lib, pkgs, ... }:

{

  imports = [
    ./config.nix
    <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
  ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.swraid.enable = true;

  fileSystems."/" = {
    device = "rpool/root/nixos";
    fsType = "zfs";
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/d155d6ff-8e89-4876-a9e7-d1b7ba6a4804";
    fsType = "ext4";
  };

  fileSystems."/backups" = {
    device = "tank/backups";
    fsType = "zfs";
  };

  fileSystems."/srv/http" = {
    device = "tank/srv-http";
    fsType = "zfs";
  };

  fileSystems."/var/download" = {
    device = "tank/download";
    fsType = "zfs";
  };

  fileSystems."/var/lib/containers" = {
    device = "tank/containers";
    fsType = "zfs";
  };

  fileSystems."/home" = {
    device = "tank/home";
    fsType = "zfs";
  };

  fileSystems."/var/lib/nextcloud" = {
    device = "tank/nextcloud";
    fsType = "zfs";
  };

  fileSystems."/var/lib/libvirt" = {
    device = "tank/libvirt";
    fsType = "zfs";
  };

  fileSystems."/var/realwallpaper/archive" = {
    device = "tank/wallpaper";
    fsType = "zfs";
  };

  fileSystems."/home/xanf" = {
    device = "/dev/disk/by-id/wwn-0x500a07511becb076";
    fsType = "ext4";
  };

  # silence mdmonitor.service failures
  # https://github.com/NixOS/nixpkgs/issues/72394
  environment.etc."mdadm.conf".text = ''
    MAILADDR root
  '';

  nix.maxJobs = lib.mkDefault 8;
  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

  boot.loader.grub.enable = true;
  boot.loader.grub.version = 2;
  boot.loader.grub.devices = [ "/dev/sda" "/dev/sdb" ];

  # we don't pay for power there and this might solve a problem we observed at least once
  # https://www.thomas-krenn.com/de/wiki/PCIe_Bus_Error_Status_00001100_beheben
  boot.kernelParams = [ "pcie_aspm=off" "net.ifnames=0" "nomodeset" ];
  networking.dhcpcd.enable = false;


  networking.useNetworkd = lib.mkForce false;
  systemd.network.enable = lib.mkForce false;
  # bridge config
  networking.bridges."ext-br".interfaces = [ "eth0" ];
  networking = {
    hostId = "2283aaae";
    defaultGateway = "95.216.1.129";
    defaultGateway6 = { address = "fe80::1"; interface = "ext-br"; };
    # Use google's public DNS server
    nameservers = [ "8.8.8.8" ];
    interfaces.ext-br.ipv4.addresses = [
      {
        address = "95.216.1.150";
        prefixLength = 26;
      }
    ];
    interfaces.ext-br.ipv6.addresses = [
      {
        address = "2a01:4f9:2a:1e9::1";
        prefixLength = 64;
      }
    ];
  };

}