summary refs log tree commit diff
path: root/hosts/vps/default.nix
blob: 7cd5f6c343e8b9df3279d6be5c3060c8fd2379ab (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
{
  config,
  lib,
  pkgs,
  ...
}: {
  imports = [
    ./hardware-configuration.nix
    ../../mixins/tailscale.nix
    ../../mixins/cli.nix
    ./services/website.nix
    ./services/git.nix
    ./services/hydrus.nix
    ./services/matrix.nix
    ./services/maloja.nix
    ./services/arXiv.nix
  ];

  config = {
    boot = {
      kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
      loader.grub.device = "/dev/vda";
      initrd = {
        availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"];
        kernelModules = [];
      };
      kernelModules = [];
      extraModulePackages = [];
    };

    time.timeZone = lib.mkDefault "Frankfurt";

    systemd.network.networks."10-ens3" = {
      matchConfig.Name = "ens3";
      networkConfig.DHCP = "yes";
      dhcpV4Config = {
        UseDNS = false;
      };
      dhcpV6Config = {
        UseDNS = false;
      };
      ipv6AcceptRAConfig = {
        UseDNS = false;
        DHCPv6Client = false;
      };
    };

    nixpkgs.config.allowUnfree = true;
    environment.persistence."/nix/persist".directories = [
      {
        directory = config.services.terraria.dataDir;
        user = "terraria";
        group = "terraria";
      }
      {
        directory = "/var/lib/private/${config.services.factorio.stateDirName}";
        user = "root";
        group = "root";
      }
    ];

    services.terraria = {
      enable = false;
      worldPath = "${config.services.terraria.dataDir}/14.wld";
      password = "???";
      openFirewall = true;
    };
    services.factorio = {
      enable = true;
      openFirewall = true;
      game-password = "???";
      requireUserVerification = false;
    };
  };
}