summaryrefslogtreecommitdiff
path: root/nixosConfigurations/yavanna/default.nix
blob: 145a872323c2cd0781ca69db7c3927986a9a7380 (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
{lib, ...}:
with lib; {
  nixfiles.modules = {
    wireguard.client.enable = true;

    syncthing.enable = true;

    acme.enable = true;

    rtorrent.enable = true;

    ipfs.enable = true;
  };

  # The /nix/var/nix/db/db.sqlite file is currently corrupt. This is technically
  # fixable with a reinstall, but this system doesn't have a recovery mode
  # access and I'm too lazy to redo everything with nixos-infect at this point.
  #
  # These services fail because of that. Although, updating configuration works
  # just fine.
  nix = {
    gc.automatic = mkForce false;
    optimise.automatic = mkForce false;
  };

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

    # NOTE This is probably not required, but I cannot test this out without
    # risking "bricking" my VPS because Kimsufi/OVH doesn't provide a console
    # access. This configuration was generated via nixos-infect[1] and at the
    # time I didn't bother to test for loaded kernel modules and just left the
    # automatically (IIRC) generated `hardware-configuration.nix' as is.
    #
    # There's, however, no indication that any NVME drives are being used and,
    # as the matter of fact, the VPS itself is on KVM, so... I'm still not going
    # to risk it, though.
    #
    # [1]: https://github.com/elitak/nixos-infect
    initrd.availableKernelModules = ["nvme"];
  };

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

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

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