about summary refs log tree commit diff
path: root/configurations/yavanna/default.nix
blob: aa3118ecc4da0ebc825c10110e18a4e904409d8b (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
  lib,
  this,
  ...
}:
with lib; {
  nixfiles.modules = {
    wireguard.client.enable = true;

    syncthing.enable = true;

    acme.enable = true;

    rtorrent.enable = true;
  };

  networking = let
    interface = "eth0";
  in {
    interfaces.${interface} = {
      ipv4.addresses = [
        {
          inherit (this.ipv4) address;
          prefixLength = 24;
        }
      ];

      ipv6.addresses = [
        {
          inherit (this.ipv6) address;
          prefixLength = 128;
        }
      ];
    };

    defaultGateway = {
      inherit interface;
      address = this.ipv4.gateway;
    };

    defaultGateway6 = {
      inherit interface;
      address = this.ipv6.gateway;
    };
  };

  boot = {
    loader.grub = {
      enable = true;
      device = "/dev/sda";
    };

    initrd = {
      availableKernelModules = ["uhci_hcd" "ahci"];
      kernelModules = ["nvme"];
    };
  };

  fileSystems."/" = {
    device = "/dev/sda1";
    fsType = "ext4";
    options = ["noatime"];
  };

  swapDevices = [
    {
      device = "/swapfile";
      size = 4 * 1024;
    }
  ];

  zramSwap = {
    enable = true;
    memoryPercent = 25;
  };
}

Consider giving Nix/NixOS a try! <3