mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-08 05:49:25 -06:00
chore: init
This commit is contained in:
commit
1b2c1ea359
891 changed files with 37053 additions and 0 deletions
48
modules/nixos/services/prompter/default.nix
Executable file
48
modules/nixos/services/prompter/default.nix
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
{ config, flake, ... }:
|
||||
let
|
||||
inherit (flake.config.services.instances)
|
||||
prompter
|
||||
;
|
||||
service = prompter;
|
||||
host = prompter.domains.url0;
|
||||
in
|
||||
{
|
||||
services = {
|
||||
caddy = {
|
||||
environmentFile = config.sops.secrets."caddy/${service.name}-auth".path;
|
||||
|
||||
virtualHosts = {
|
||||
"${host}" = {
|
||||
extraConfig = ''
|
||||
basicauth {
|
||||
{$CADDY_AUTH_USER} {$CADDY_AUTH_PASSWORD_HASH}
|
||||
}
|
||||
root * ${service.paths.path0}
|
||||
file_server
|
||||
encode gzip
|
||||
try_files {path} /index.html
|
||||
tls ${service.ssl.cert} ${service.ssl.key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
sops =
|
||||
let
|
||||
sopsPath = secret: {
|
||||
path = "${service.sops.path0}/${service.name}-${secret}.env";
|
||||
owner = "caddy";
|
||||
mode = "0400";
|
||||
};
|
||||
in
|
||||
{
|
||||
secrets = {
|
||||
"caddy/${service.name}-auth" = sopsPath "auth";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${service.paths.path0} 755 caddy caddy -"
|
||||
"Z ${service.sops.path0} 755 caddy caddy -"
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue