Clean up and add services

Remove jupyter service and qbittorrent traefik route

Add ntfy-sh (enabled) and initial grafana (not enabled) expressions

Change services to call own traefik expression, rather than needing to
be called explicitly
This commit is contained in:
Evie Litherland-Smith 2023-10-21 17:55:11 +01:00
parent 8421a5eeb5
commit a1c28e779a
17 changed files with 115 additions and 80 deletions

View file

@ -229,17 +229,11 @@
in systemConfig {
inherit hostName user system;
systemModules = [ ./system/default.nix ];
serviceModules = [
# ./services/adguardhome/default.nix
serviceModules = default.serviceModules ++ [
./services/adguardhome/default.nix
./services/gitea/default.nix
./services/nextcloud/default.nix
./services/sshd/default.nix
./services/syncthing/default.nix
# ./services/terraria/windy_limbo_of_melancholy.nix
# ./services/traefik/adguardhome.nix
./services/traefik/gitea.nix
./services/traefik/nextcloud.nix
# ./services/traefik/qbittorrent.nix
./services/ntfy-sh/default.nix
];
homeModules = [ ./home/default.nix ];
};

View file

@ -1,4 +1,7 @@
{...}: {
{ ... }:
{
imports = [ ../traefik/adguardhome.nix ];
services.adguardhome = {
enable = true;
mutableSettings = true;

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
services.fail2ban = {
enable = true;
ignoreIP = [ "127.0.0.1/8" "::1" "192.168.1.0/16" ];

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services.fail2ban.jails.traefik = ''
enabled = true

View file

@ -1,4 +1,7 @@
{...}: {
{ ... }:
{
imports = [ ../traefik/gitea.nix ];
services.gitea = {
enable = true;
settings = {
@ -9,7 +12,8 @@
};
service.DISABLE_REGISTRATION = true;
ui = {
THEMES = "auto,gitea,arc-green,catppuccin-latte-lavender,catppuccin-frappe-lavender,catppuccin-macchiato-lavender,catppuccin-mocha-lavender";
THEMES =
"auto,gitea,arc-green,catppuccin-latte-lavender,catppuccin-frappe-lavender,catppuccin-macchiato-lavender,catppuccin-mocha-lavender";
};
};
appName = "Gitea";

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
services.grafana = {
enable = true;
settings = {
server = {
http_addr = "127.0.0.1";
http_port = 3100;
domain = "grafana.xenia.me.uk";
};
};
};
}

View file

@ -1,11 +0,0 @@
{...}: {
users.users.jupyter.group = "jupyter";
users.groups.jupyter = {};
services.jupyter = {
enable = true;
notebookConfig = ''
c.FileCheckpoints.checkpoint_dir = c.ServerApp.root_dir + ".ipynb_checkpoints"
c.ServerApp.open_browser = False
'';
};
}

View file

@ -1,7 +0,0 @@
{pkgs, ...}: {
imports = [./default.nix];
services.jupyter = {
command = "jupyter-lab";
package = pkgs.python3Packages.jupyterlab;
};
}

View file

@ -1,4 +1,7 @@
{ pkgs, config, ... }: {
{ pkgs, config, ... }:
{
imports = [ ../traefik/nextcloud.nix ];
services.nextcloud = {
enable = true;
package = pkgs.nextcloud27;

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
services.ntfy-sh = {
enable = true;
settings = {
base-url = "https://ntfy.xenia.me.uk";
listen-http = ":8800";
behind-proxy = true;
enable-signup = false;
enable-metrics = true;
};
};
}

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
services.openssh = {
enable = true;
ports = [ 22 ];

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services.traefik.dynamicConfigOptions.http = {
routers.adguard = {
@ -7,6 +9,7 @@
service = "adguard-webinterface";
tls = { certResolver = "default"; };
};
services.adguard-webinterface.loadBalancer.servers = [{url = "http://localhost:3001";}];
services.adguard-webinterface.loadBalancer.servers =
[{ url = "http://localhost:3001"; }];
};
}

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
imports = [ ../fail2ban/traefik.nix ];
services.traefik = {
enable = true;
@ -43,7 +45,8 @@
};
};
middlewares = {
auth.basicAuth.users = ["xenia:$apr1$LB0wVd6I$BHVPIyh.F5Ewt9/7PqAtS."];
auth.basicAuth.users =
[ "xenia:$apr1$LB0wVd6I$BHVPIyh.F5Ewt9/7PqAtS." ];
hsts.headers = {
stsSeconds = "31536000";
stsIncludeSubdomains = true;

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services.traefik.dynamicConfigOptions = {
http = {
@ -8,7 +10,8 @@
service = "gitea-websecure";
tls = { certResolver = "default"; };
};
services.gitea-websecure.loadBalancer.servers = [{url = "http://localhost:3000";}];
services.gitea-websecure.loadBalancer.servers =
[{ url = "http://localhost:3000"; }];
};
};
}

View file

@ -1,4 +1,6 @@
{...}: {
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services.traefik.dynamicConfigOptions.http = {
routers.nextcloud = {
@ -8,6 +10,7 @@
middlewares = [ "hsts" ];
tls = { certResolver = "default"; };
};
services.nextcloud-webinterface.loadBalancer.servers = [{url = "http://localhost:8000";}];
services.nextcloud-webinterface.loadBalancer.servers =
[{ url = "http://localhost:8000"; }];
};
}

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services.traefik.dynamicConfigOptions = {
http = {
routers.ntfy-sh = {
rule = "Host(`ntfy.xenia.me.uk`)";
entryPoints = [ "http" "https" ];
service = "ntfy-sh-service";
tls = { certResolver = "default"; };
};
services.ntfy-sh-service.loadBalancer.servers =
[{ url = "http://localhost:8800"; }];
};
};
}

View file

@ -1,14 +0,0 @@
{pkgs, ...}: {
imports = [./default.nix];
environment.systemPackages = [pkgs.qbittorrent];
services.traefik.dynamicConfigOptions.http = {
routers.qbittorrent = {
rule = "Host(`torrent.xenia.me.uk`)";
entryPoints = ["http" "https"];
service = "qbittorrent-webinterface";
middlewares = ["auth"];
tls = {certResolver = "default";};
};
services.qbittorrent-webinterface.loadBalancer.servers = [{url = "http://localhost:8090";}];
};
}