2021-09-27 14:55:55 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardware-configuration.nix
|
|
|
|
./data/secrets/secrets.nix
|
|
|
|
../../common/services/ssh.nix
|
2022-10-24 11:13:11 +02:00
|
|
|
../../common/services/tailscale.nix
|
|
|
|
../../common/users.nix
|
2021-09-28 11:55:33 +02:00
|
|
|
./services/acme.nix
|
2021-09-27 14:55:55 +02:00
|
|
|
./services/nextcloud.nix
|
|
|
|
./services/nginx.nix
|
|
|
|
./services/postgres.nix
|
2021-09-28 11:55:33 +02:00
|
|
|
./services/redis.nix
|
|
|
|
./services/restic.nix
|
2021-09-27 14:55:55 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
boot.loader.grub.enable = true;
|
|
|
|
boot.loader.grub.device = "/dev/sda";
|
2023-06-17 12:22:58 +02:00
|
|
|
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
2021-09-27 14:55:55 +02:00
|
|
|
|
|
|
|
boot.supportedFilesystems = ["zfs"];
|
2022-08-23 18:36:50 +02:00
|
|
|
services.zfs.autoSnapshot.enable = false;
|
2021-09-27 14:55:55 +02:00
|
|
|
services.zfs.autoScrub.enable = true;
|
|
|
|
|
|
|
|
time.timeZone = "Europe/Copenhagen";
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "rudiger";
|
|
|
|
hostId = "8c7b66a4";
|
|
|
|
useDHCP = false;
|
|
|
|
tempAddresses = "disabled";
|
|
|
|
interfaces = {
|
|
|
|
"ens3" = {
|
|
|
|
ipv4.addresses = [ {
|
|
|
|
address = "202.61.202.170";
|
|
|
|
prefixLength = 22;
|
|
|
|
} ];
|
|
|
|
ipv6.addresses = [ {
|
|
|
|
address = "2a03:4000:5a:c61::1";
|
|
|
|
prefixLength = 64;
|
|
|
|
} ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
defaultGateway = "202.61.200.1";
|
|
|
|
defaultGateway6 = {
|
|
|
|
address = "fe80::1";
|
|
|
|
interface = "ens3";
|
|
|
|
};
|
|
|
|
nameservers = [ "1.1.1.1" "1.0.0.1" "2606:4700:4700::1111" "2606:4700:4700::1001" ];
|
|
|
|
};
|
|
|
|
|
2022-02-26 16:09:12 +01:00
|
|
|
|
2022-09-17 13:42:25 +02:00
|
|
|
nix.settings = {
|
|
|
|
auto-optimise-store = true;
|
|
|
|
trusted-users = [
|
2021-09-27 14:55:55 +02:00
|
|
|
"root"
|
|
|
|
"@wheel"
|
|
|
|
];
|
|
|
|
};
|
2021-12-18 09:58:36 +01:00
|
|
|
|
2021-09-27 14:55:55 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
vim
|
|
|
|
wget
|
|
|
|
htop
|
|
|
|
iotop
|
|
|
|
dig
|
2022-10-24 11:13:11 +02:00
|
|
|
tailscale
|
2021-09-27 14:55:55 +02:00
|
|
|
];
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
|
|
|
systemd.services."nextcloud-setup" = {
|
2021-09-28 11:55:33 +02:00
|
|
|
requires = [ "postgresql.service" "redis.service" ];
|
|
|
|
after = [ "postgresql.service" "redis.service" ];
|
2021-09-27 14:55:55 +02:00
|
|
|
};
|
|
|
|
|
2021-09-28 11:55:33 +02:00
|
|
|
users.groups.redis.members = [ "nextcloud" ];
|
|
|
|
users.groups.backup.members = [ "nextcloud" "postgres" ];
|
|
|
|
|
2022-10-24 11:13:11 +02:00
|
|
|
networking.firewall = {
|
|
|
|
allowedTCPPorts = [ 22 80 443 ];
|
|
|
|
allowedUDPPorts = [ config.services.tailscale.port ];
|
|
|
|
trustedInterfaces = [ "tailscale0" ];
|
|
|
|
enable = true;
|
|
|
|
checkReversePath = "loose";
|
|
|
|
};
|
2021-09-27 14:55:55 +02:00
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
system.stateVersion = "21.05";
|
|
|
|
|
|
|
|
}
|