mirror of
https://codeberg.org/puppe/financier-nix.git
synced 2025-12-20 00:12:17 +01:00
This module adds the necessary configuration for hosting Financier with nginx.
32 lines
699 B
Nix
32 lines
699 B
Nix
{ config, lib, pkgs, system, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.services.financier;
|
|
financier-dist = import ./dist.nix { inherit pkgs system; };
|
|
in
|
|
{
|
|
imports = [];
|
|
|
|
options.services.financier = {
|
|
enable = mkEnableOption "Financier";
|
|
|
|
hostName = mkOption {
|
|
type = types.str;
|
|
description = ''
|
|
Name for the nginx virtual host.
|
|
'';
|
|
example = "example.org";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
services.nginx.virtualHosts."${cfg.hostName}" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
root = financier-dist;
|
|
locations."/".tryFiles = "$uri $uri/ /index.html";
|
|
};
|
|
};
|
|
}
|