mirror of
https://codeberg.org/puppe/financier-nix.git
synced 2025-12-20 00:12:17 +01:00
Add NixOS module
This module adds the necessary configuration for hosting Financier with nginx.
This commit is contained in:
parent
f1d4ed0e75
commit
b8ff16e98a
1 changed files with 32 additions and 0 deletions
32
module.nix
Normal file
32
module.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue