1
Fork 0
satellite/hosts/nixos/lapetus/services/intray.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2024-02-02 02:44:51 +01:00
{ inputs, config, ... }:
let
username = "prescientmoon";
apiHost = "api.intray.moonythm.dev";
apiPort = 8402;
webHost = "intray.moonythm.dev";
webPort = 8403;
in
{
# {{{ Import intray module
imports = [
2024-02-02 02:44:22 +01:00
../../common/optional/services/nginx.nix
# We patch out the `intray` module to allow manual configuration for nginx
2024-02-02 02:46:27 +01:00
({ lib, pkgs, config, ... }:
2024-02-02 02:43:40 +01:00
# NOTE: using `pkgs.system` before `module.options` is evaluated
# leads to infinite recursion!
2024-02-02 02:46:27 +01:00
let m = inputs.intray.nixosModules.x86_64-linux.default { inherit lib pkgs config; };
2024-02-02 02:43:40 +01:00
in
{
inherit (m) options;
2024-02-02 02:48:45 +01:00
config.systemd = lib.mkIf config.services.intray.production.enable m.config.systemd;
2024-02-02 02:43:40 +01:00
})
];
# }}}
# {{{ Configure intray
services.intray.production = {
enable = true;
api-server = {
enable = true;
hosts = [ apiHost ];
port = apiPort;
admins = [ username ];
};
web-server = {
enable = true;
hosts = [ webHost ];
port = webPort;
api-url = "https://${apiHost}";
};
};
# }}}
# {{{ Networking & storage
services.nginx.virtualHosts.${apiHost} = config.satellite.proxy apiPort;
services.nginx.virtualHosts.${webHost} = config.satellite.proxy webPort;
environment.persistence."/persist/state".directories = [
"/www/intray/production/data"
];
# }}}
}