nix-config/server-configuration.nix

132 lines
2.2 KiB
Nix
Raw Normal View History

2024-07-08 19:11:59 +02:00
{
config,
lib,
pkgs,
...
}:
let
ip = "192.168.1.177";
2024-07-11 12:25:10 +02:00
gateway = "192.168.1.1";
driveMountPoint = "/srv/Multimedia";
username = "homelab";
2024-07-08 19:11:59 +02:00
in
{
imports = [
./features/authentik.nix
./features/slskd.nix
./features/arr-suite.nix
./features/samba-shares.nix
./features/containers.nix
./features/homelab-dashboard.nix
./features/transmission.nix
];
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 = [
22
5030
8080
9091
];
2024-07-08 19:11:59 +02:00
allowedUDPPorts = [ ];
};
};
2024-07-11 12:25:10 +02:00
users.groups.multimedia = {
members = [
"slskd"
"radarr"
"readarr"
"sonarr"
"transmission"
"jellyfin"
username
2024-07-11 12:25:10 +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"`
sops.secrets."searx" = {
2024-07-08 19:11:59 +02:00
sopsFile = ./secrets/searx.env;
format = "dotenv";
};
environment.systemPackages = with pkgs; [
jellyfin
jellyfin-web
jellyfin-ffmpeg
transmission
sonarr
radarr
prowlarr
readarr
jellyseerr
homepage-dashboard
slskd
];
services.jellyfin = {
enable = true;
openFirewall = true;
};
2024-07-11 12:25:10 +02:00
# -arr suite
2024-07-08 19:11:59 +02:00
services.searx = {
enable = true;
settings = {
2024-07-11 12:25:10 +02:00
server.secret_key = builtins.toJSON config.sops.secrets."searx";
2024-07-08 19:11:59 +02:00
};
};
services.calibre-web = {
enable = true;
openFirewall = true;
options = {
enableBookUploading = true;
};
};
2024-07-11 12:25:10 +02:00
services.caddy = {
enable = true;
virtualHosts.":80".extraConfig = ''
2024-07-11 12:25:10 +02:00
reverse_proxy :8082
'';
2024-07-11 12:25:10 +02:00
};
2024-07-08 19:11:59 +02:00
/*
2024-07-11 12:25:10 +02:00
services.photoprism = {
enable = true;
settings = {
PHOTOPRISM_DEFAULT_LOCALE = "fr";
2024-07-08 19:11:59 +02:00
};
};
*/
2024-07-08 19:11:59 +02:00
2024-07-08 19:37:54 +02:00
}