50 lines
959 B
Nix
50 lines
959 B
Nix
|
{config, pkgs, ...}:
|
||
|
let
|
||
|
caddyDir = "/var/lib/caddy";
|
||
|
in
|
||
|
{
|
||
|
services.caddy = {
|
||
|
enable = true;
|
||
|
email = "lucazeau.alexandre@gmail.com";
|
||
|
config = ''
|
||
|
{
|
||
|
storage file_system {
|
||
|
root ${caddyDir}
|
||
|
}
|
||
|
}
|
||
|
https://git.atlanticaweb.fr {
|
||
|
encode gzip
|
||
|
reverse_proxy http://localhost:3001
|
||
|
}
|
||
|
atlanticaweb.fr {
|
||
|
root * /srv/www/atlanticaweb.fr
|
||
|
encode gzip zstd
|
||
|
file_server
|
||
|
}
|
||
|
atlanticaweb.fr:2021 {
|
||
|
metrics
|
||
|
}
|
||
|
www.atlanticaweb.fr {
|
||
|
redir https://atlanticaweb.fr{uri}
|
||
|
}
|
||
|
pizzajoffre.fr {
|
||
|
root * /srv/www/pizzajoffre.fr
|
||
|
encode gzip zstd
|
||
|
file_server
|
||
|
}
|
||
|
www.pizzajoffre.fr {
|
||
|
redir https://pizzajoffre.fr{uri}
|
||
|
}
|
||
|
'';
|
||
|
};
|
||
|
users.users.caddy = {
|
||
|
group = "caddy";
|
||
|
uid = config.ids.uids.caddy;
|
||
|
home = caddyDir;
|
||
|
createHome = true;
|
||
|
extraGroups = [ "users" ];
|
||
|
};
|
||
|
|
||
|
users.groups.caddy.gid = config.ids.uids.caddy;
|
||
|
}
|