mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 04:58:19 -04:00
made web_services dir
This commit is contained in:
@@ -15,6 +15,7 @@ in
|
|||||||
"${inputs.self}/common/optional/zerotier.nix"
|
"${inputs.self}/common/optional/zerotier.nix"
|
||||||
./docker
|
./docker
|
||||||
./services
|
./services
|
||||||
|
./web_services
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./programs.nix
|
./programs.nix
|
||||||
|
|||||||
@@ -1,39 +1,30 @@
|
|||||||
|
let
|
||||||
|
domains = [
|
||||||
|
"audiobookshelf"
|
||||||
|
"cache"
|
||||||
|
"gitea"
|
||||||
|
"jellyfin"
|
||||||
|
"share"
|
||||||
|
];
|
||||||
|
|
||||||
|
makeCert = name: {
|
||||||
|
name = "${name}.tmmworkshop.com";
|
||||||
|
value = {
|
||||||
|
webroot = "/var/lib/acme/.challenges";
|
||||||
|
group = "acme";
|
||||||
|
reloadServices = [ "haproxy.service" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
acmeServices = map (domain: "acme-${domain}.tmmworkshop.com.service") domains;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
users.users.haproxy.extraGroups = [ "acme" ];
|
users.users.haproxy.extraGroups = [ "acme" ];
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults.email = "Richie@tmmworkshop.com";
|
defaults.email = "Richie@tmmworkshop.com";
|
||||||
|
certs = builtins.listToAttrs (map makeCert domains);
|
||||||
certs."gitea.tmmworkshop.com" = {
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
group = "acme";
|
|
||||||
reloadServices = [ "haproxy.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
certs."audiobookshelf.tmmworkshop.com" = {
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
group = "acme";
|
|
||||||
reloadServices = [ "haproxy.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
certs."cache.tmmworkshop.com" = {
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
group = "acme";
|
|
||||||
reloadServices = [ "haproxy.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
certs."jellyfin.tmmworkshop.com" = {
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
group = "acme";
|
|
||||||
reloadServices = [ "haproxy.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
certs."share.tmmworkshop.com" = {
|
|
||||||
webroot = "/var/lib/acme/.challenges";
|
|
||||||
group = "acme";
|
|
||||||
reloadServices = [ "haproxy.service" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Minimal nginx to serve ACME HTTP-01 challenge files for HAProxy
|
# Minimal nginx to serve ACME HTTP-01 challenge files for HAProxy
|
||||||
@@ -60,4 +51,12 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
users.users.nginx.extraGroups = [ "acme" ];
|
users.users.nginx.extraGroups = [ "acme" ];
|
||||||
|
|
||||||
|
# HAProxy needs certs to exist before it can bind :443.
|
||||||
|
# NixOS's acme module generates self-signed placeholders on first boot
|
||||||
|
# via acme-<domain>.service — just make HAProxy wait for them.
|
||||||
|
systemd.services.haproxy = {
|
||||||
|
after = acmeServices;
|
||||||
|
wants = acmeServices;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
9
systems/jeeves/web_services/default.nix
Normal file
9
systems/jeeves/web_services/default.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
let
|
||||||
|
files = builtins.attrNames (builtins.readDir ./.);
|
||||||
|
nixFiles = builtins.filter (name: lib.hasSuffix ".nix" name && name != "default.nix") files;
|
||||||
|
in
|
||||||
|
map (file: ./. + "/${file}") nixFiles;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user