1
0
Fork 0
dotfiles/system/nixos/anonymous-overflow.nix

42 lines
1 KiB
Nix
Raw Normal View History

2023-02-15 19:35:46 +00:00
{ pkgs, config, ... }:
let
anonymous-overflow-pkg = pkgs.anonymous-overflow;
in
{
systemd.services.anonymous-overflow = {
description = "View StackOverflow in privacy and without the clutter";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
DynamicUser = true;
StateDirectory = "anonymous-overflow";
EnvironmentFile = [ config.age.secrets.anonymous-overflow-config.path ];
ExecStart = "${anonymous-overflow-pkg}/bin/anonymousoverflow";
Restart = "on-failure";
RestartSec = "5s";
};
};
services.nginx = {
enable = true;
virtualHosts."anonymous-overflow.only.internal" = {
listen = [
{
addr = "127.0.0.1";
port = 80;
}
];
forceSSL = false;
enableACME = false;
locations."/" = {
basicAuthFile = config.age.secrets.anonymous-overflow-auth.path;
recommendedProxySettings = true;
proxyPass = "http://127.0.0.1:8003";
};
};
};
}