-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.nix
75 lines (64 loc) · 1.73 KB
/
server.nix
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, pkgs, ... }:
let
vars = import ./vars.nix;
in
{
# Global packages
environment = {
systemPackages = with pkgs; [ fluxcd ];
sessionVariables = {
KUBECONFIG = "/home/guibi/kubeconfig.yaml";
};
};
# Networking options
networking = {
interfaces.eno1.ipv4.addresses = [ {
address = "192.168.18.222";
prefixLength = 24;
} ];
defaultGateway = "192.168.18.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
firewall = {
allowedTCPPorts = [
6443 # k3s: required so that pods can reach the API server (running on port 6443 by default)
];
allowedUDPPorts = [
27020
];
};
};
# Services options
services = {
fail2ban.enable = true;
openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = false;
AllowUsers = [ "guibi" ];
UseDns = true;
X11Forwarding = false;
PermitRootLogin = "no";
};
};
k3s = {
enable = true;
role = "server";
clusterInit = true;
extraFlags = "--service-node-port-range=27000-30000";
};
};
# ZFS
boot = {
supportedFilesystems = [ "zfs" ];
zfs = {
forceImportRoot = false;
extraPools = [ "SSD" "Data" ];
};
};
# Found on github.com/openebs/openebs/issues/3727#issuecomment-2366776183
systemd.tmpfiles.rules = [
"L+ /usr/local/bin - - - - /run/current-system/sw/bin/"
];
networking.hostId = "6d57a4c5";
}