chore: organise modules

Organise modules in a significantly better way with categories.
This commit is contained in:
Nico 2025-05-03 16:16:03 +10:00
parent 7444260d7d
commit 3660ef23f1
33 changed files with 77 additions and 76 deletions

104
modules/services/glance.nix Normal file
View file

@ -0,0 +1,104 @@
{ config, lib, pkgs, ... }:
{
services.glance = {
enable = true;
settings.server.port = 80;
settings.server.host = "0.0.0.0";
openFirewall = true;
settings = {
pages = [
{
name = "Home";
hide-desktop-navigation = true;
columns = [
{
size = "full";
widgets = [
{
type = "group";
widgets = [
{
type = "clock";
hour-format = "24h";
timezones = [
{
timezone = "Australia/Sydney";
label = "Sydney";
}
{
timezone = "Europe/London";
label = "London";
}
{
timezone = "Europe/Moscow";
label = "Moscow";
}
];
}
{
type = "weather";
location = "Sydney, Australia";
units = "metric"; # alternatively "imperial"
hour-format = "12h"; # alternatively "24h"
}
{
type = "calendar";
first-day-of-week = "monday";
}
];
}
{
type = "bookmarks";
groups = [
{
title = "Media";
color = "10 70 50";
links = [
{
title = "Jellyfin";
url = "http://${config.networking.hostName}:8096";
}
{
title = "Jellyseer";
url = "http://${config.networking.hostName}:5055";
}
{
title = "Radarr";
url = "http://${config.networking.hostName}:7878";
}
{
title = "Sonarr";
url = "http://${config.networking.hostName}:8989";
}
{
title = "Lidarr";
url = "http://${config.networking.hostName}:8686";
}
{
title = "Prowlarr";
url = "http://${config.networking.hostName}:9696";
}
{
title = "Bazarr";
url = "http://${config.networking.hostName}:6767";
}
{
title = "Deluge";
url = "http://${config.networking.hostName}:8112";
}
];
}
];
}
];
}
];
}
];
};
};
# allow services to bind to port 80
boot.kernel.sysctl."net.ipv4.ip_unprivileged_port_start" = 0;
}

View file

@ -0,0 +1,55 @@
{ config, lib, pkgs, ...}:
{
users.groups.media = {};
# Finding/Requesting downloading
services.radarr = {
enable = true;
openFirewall = true;
dataDir = "/var/lib/radarr";
group = "media";
};
services.sonarr = {
enable = true;
openFirewall = true;
dataDir = "/var/lib/sonarr";
group = "media";
};
services.lidarr = {
enable = true;
openFirewall = true;
dataDir = "/var/lib/lidarr";
group = "media";
};
services.prowlarr = {
enable = true;
openFirewall = true;
};
services.bazarr = {
enable = true;
openFirewall = true;
group = "media";
};
# Downloading files
services.deluge = {
enable = true;
web.enable = true;
web.openFirewall = true;
group = "media";
};
# Requesting Frontend
services.jellyseerr = {
enable = true;
port = 5055;
openFirewall = true;
package = pkgs.jellyseerr;
};
}

View file

@ -0,0 +1,10 @@
{ ... }:
{
# Streaming frontend
services.jellyfin = {
enable = true;
openFirewall = true;
group = "media";
};
}

27
modules/services/ssh.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
{
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
allowSFTP = true;
openFirewall = false;
authorizedKeysInHomedir = false;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
GatewayPorts = "no";
};
};
# add ssh key
users.users.nico.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHzUJnqCpbRxggjyIZo4KWnTyHobPdi/xXkN1/n/yIMD"
];
# enable ssh in the firewall
networking.firewall.allowedTCPPorts = [ 22 ];
# enable fail2ban
services.fail2ban.enable = true;
}