43 lines
814 B
Nix
43 lines
814 B
Nix
|
|
{ lib, config, pkgs, ... }:
|
|
let
|
|
caddyDir = "/var/lib/caddy";
|
|
in
|
|
{
|
|
services.restic.server = {
|
|
enable = true;
|
|
|
|
extraFlags = [ "--no-auth" ];
|
|
dataDir = "/var/lib/backup";
|
|
prometheus = true;
|
|
listenAddress = "127.0.0.1:8080";
|
|
};
|
|
networking = {
|
|
firewall.enable = true;
|
|
firewall.allowedTCPPorts = [ 80 443 ];
|
|
};
|
|
services.caddy = {
|
|
enable = true;
|
|
email = "lucazeau.alexandre@gmail.com";
|
|
config = ''
|
|
{
|
|
storage file_system {
|
|
root ${caddyDir}
|
|
}
|
|
}
|
|
https://back.atlanticaweb.fr {
|
|
reverse_proxy http://127.0.0.1:8080
|
|
}
|
|
'';
|
|
};
|
|
users.users.caddy = {
|
|
group = "caddy";
|
|
uid = config.ids.uids.caddy;
|
|
home = caddyDir;
|
|
createHome = true;
|
|
extraGroups = [ "users" ];
|
|
};
|
|
|
|
users.groups.caddy.gid = config.ids.uids.caddy;
|
|
}
|