2025-01-01 14:27:58 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-31 10:48:44 +00:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.features.homelab.freshrss;
|
|
|
|
port = 4003;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.features.homelab.freshrss.enable = mkEnableOption "Enable freshrss";
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# Auto-generated using compose2nix v0.3.2-pre.
|
|
|
|
virtualisation = {
|
|
|
|
docker = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
oci-containers.backend = "docker";
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualisation.oci-containers.containers."freshrss" = {
|
|
|
|
image = "lscr.io/linuxserver/freshrss:latest";
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
"PGID" = "1000";
|
|
|
|
"PUID" = "1000";
|
|
|
|
"TZ" = "Etc/UTC";
|
|
|
|
};
|
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"/home/opdavies/Code/dotfiles/freshrss-config:/config:rw"
|
|
|
|
];
|
|
|
|
|
|
|
|
ports = [
|
|
|
|
"${toString port}:80/tcp"
|
|
|
|
];
|
|
|
|
|
|
|
|
log-driver = "journald";
|
|
|
|
|
|
|
|
extraOptions = [
|
|
|
|
"--network-alias=freshrss"
|
|
|
|
"--network=freshrss_default"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."docker-freshrss" = {
|
|
|
|
serviceConfig = {
|
|
|
|
Restart = lib.mkOverride 90 "always";
|
|
|
|
RestartMaxDelaySec = lib.mkOverride 90 "1m";
|
|
|
|
RestartSec = lib.mkOverride 90 "100ms";
|
|
|
|
RestartSteps = lib.mkOverride 90 9;
|
|
|
|
};
|
|
|
|
|
|
|
|
after = [
|
|
|
|
"docker-network-freshrss_default.service"
|
|
|
|
];
|
|
|
|
|
|
|
|
requires = [
|
|
|
|
"docker-network-freshrss_default.service"
|
|
|
|
];
|
|
|
|
|
|
|
|
partOf = [
|
|
|
|
"docker-compose-freshrss-root.target"
|
|
|
|
];
|
|
|
|
|
|
|
|
wantedBy = [
|
|
|
|
"docker-compose-freshrss-root.target"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."docker-network-freshrss_default" = {
|
|
|
|
path = [ pkgs.docker ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
ExecStop = "docker network rm -f freshrss_default";
|
|
|
|
};
|
|
|
|
|
|
|
|
script = ''
|
|
|
|
docker network inspect freshrss_default || docker network create freshrss_default
|
|
|
|
'';
|
|
|
|
|
|
|
|
partOf = [ "docker-compose-freshrss-root.target" ];
|
|
|
|
wantedBy = [ "docker-compose-freshrss-root.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.targets."docker-compose-freshrss-root" = {
|
|
|
|
unitConfig = {
|
|
|
|
Description = "Root target generated by compose2nix.";
|
|
|
|
};
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
|
2025-01-01 14:45:03 +00:00
|
|
|
services.caddy.virtualHosts."freshrss.opdavies.uk" = {
|
|
|
|
useACMEHost = "opdavies.uk";
|
2024-12-31 10:48:44 +00:00
|
|
|
|
2025-01-01 14:45:03 +00:00
|
|
|
extraConfig = "reverse_proxy localhost:${toString port}";
|
2024-12-31 10:48:44 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|