2024-07-08 19:11:59 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
2024-07-14 15:48:01 +02:00
|
|
|
ip = "192.168.1.177";
|
2024-07-11 12:25:10 +02:00
|
|
|
gateway = "192.168.1.1";
|
2024-07-14 15:48:01 +02:00
|
|
|
username = "homelab";
|
2024-07-08 19:11:59 +02:00
|
|
|
in
|
|
|
|
{
|
2024-07-14 15:48:01 +02:00
|
|
|
imports = [
|
|
|
|
./features/arr-suite.nix
|
2024-07-15 16:27:23 +02:00
|
|
|
./features/authentik.nix
|
|
|
|
./features/calibre-web.nix
|
2024-07-14 15:48:01 +02:00
|
|
|
./features/containers.nix
|
2024-07-15 16:27:23 +02:00
|
|
|
./features/freshrss.nix
|
|
|
|
./features/grafana.nix
|
2024-07-14 15:48:01 +02:00
|
|
|
./features/homelab-dashboard.nix
|
2024-07-15 16:27:23 +02:00
|
|
|
./features/samba-shares.nix
|
|
|
|
./features/searx.nix
|
|
|
|
# ./features/synapse-matrix.nix
|
|
|
|
./features/slskd.nix
|
2024-07-14 15:48:01 +02:00
|
|
|
./features/transmission.nix
|
2024-07-15 16:27:23 +02:00
|
|
|
./features/uptime-kuma.nix
|
2024-07-14 15:48:01 +02:00
|
|
|
];
|
|
|
|
|
2024-07-08 19:11:59 +02:00
|
|
|
# setting up networking!!
|
|
|
|
networking = {
|
|
|
|
interfaces = {
|
|
|
|
ens18.ipv4.addresses = [
|
|
|
|
{
|
|
|
|
address = ip;
|
|
|
|
prefixLength = 24;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-07-11 12:25:10 +02:00
|
|
|
defaultGateway = gateway;
|
2024-07-08 19:11:59 +02:00
|
|
|
nameservers = [
|
|
|
|
"1.1.1.1"
|
|
|
|
"1.0.0.1"
|
|
|
|
];
|
|
|
|
nftables.enable = true;
|
|
|
|
# firewall rules
|
|
|
|
firewall = {
|
|
|
|
enable = true;
|
2024-07-08 19:37:54 +02:00
|
|
|
allowedTCPPorts = [
|
2024-07-16 15:07:52 +02:00
|
|
|
22 # ssh
|
2024-07-16 15:57:38 +02:00
|
|
|
3001 # grafana
|
|
|
|
4001 # uptime-kuma
|
2024-07-15 16:27:23 +02:00
|
|
|
5030 # slskd
|
|
|
|
8080 # searxng
|
|
|
|
8083 # calibre-web
|
|
|
|
8443 # crafty-controller
|
2024-07-16 15:07:52 +02:00
|
|
|
9000 # authentik
|
2024-07-15 16:27:23 +02:00
|
|
|
9091 # transmission
|
2024-07-08 19:37:54 +02:00
|
|
|
];
|
2024-07-08 19:11:59 +02:00
|
|
|
allowedUDPPorts = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-15 16:27:23 +02:00
|
|
|
#TODO: setup fail2ban
|
|
|
|
services.fail2ban = {
|
|
|
|
enable = true;
|
|
|
|
ignoreIP = [ "192.168.1.0/24" ];
|
|
|
|
extraPackages = [ ];
|
|
|
|
jails = { };
|
|
|
|
};
|
2024-07-11 12:25:10 +02:00
|
|
|
users.groups.multimedia = {
|
|
|
|
members = [
|
|
|
|
"slskd"
|
|
|
|
"radarr"
|
|
|
|
"readarr"
|
|
|
|
"sonarr"
|
|
|
|
"transmission"
|
|
|
|
"jellyfin"
|
2024-07-15 16:27:23 +02:00
|
|
|
"bazarr"
|
2024-07-14 15:48:01 +02:00
|
|
|
username
|
2024-07-11 12:25:10 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-07-14 15:48:01 +02:00
|
|
|
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
2024-07-08 19:11:59 +02:00
|
|
|
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
|
|
|
|
sops.age.generateKey = true;
|
|
|
|
|
2024-07-11 12:25:10 +02:00
|
|
|
# define your secrets with
|
|
|
|
# `nix-shell -p sops --run "sops ./secrets/yoursecret.env"`
|
|
|
|
|
2024-07-08 19:11:59 +02:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
jellyfin
|
|
|
|
jellyfin-web
|
|
|
|
jellyfin-ffmpeg
|
|
|
|
transmission
|
|
|
|
sonarr
|
|
|
|
radarr
|
|
|
|
prowlarr
|
|
|
|
readarr
|
|
|
|
jellyseerr
|
|
|
|
homepage-dashboard
|
|
|
|
slskd
|
2024-07-15 16:27:23 +02:00
|
|
|
bazarr
|
2024-07-08 19:11:59 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
services.jellyfin = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
2024-07-11 12:25:10 +02:00
|
|
|
services.caddy = {
|
|
|
|
enable = true;
|
2024-07-16 14:38:00 +02:00
|
|
|
virtualHosts.":80".extraConfig = ''
|
2024-07-11 12:25:10 +02:00
|
|
|
reverse_proxy :8082
|
|
|
|
'';
|
2024-07-16 15:56:00 +02:00
|
|
|
|
|
|
|
virtualHosts.":3001".extraConfig = ''
|
|
|
|
reverse_proxy :3000
|
|
|
|
'';
|
|
|
|
virtualHosts.":4001".extraConfig = ''
|
|
|
|
reverse_proxy :4000
|
|
|
|
'';
|
2024-07-11 12:25:10 +02:00
|
|
|
};
|
2024-07-08 19:37:54 +02:00
|
|
|
}
|