Site max en module
This commit is contained in:
parent
735d4e2c33
commit
c365ca44f7
2 changed files with 39 additions and 5 deletions
35
services/site-max.nix
Normal file
35
services/site-max.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.site-max;
|
||||
in
|
||||
{
|
||||
options.services.site-max = {
|
||||
enable = mkEnableOption "Site Max Spiegel";
|
||||
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
example = 54321;
|
||||
description = "Local listening port";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.haproxy-acme.services = {
|
||||
max = { ip = "127.0.0.1"; port = cfg.port; auth = false; };
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"max" = {
|
||||
listen = [ { addr = "127.0.0.1"; port = cfg.port; } ];
|
||||
locations."/" = {
|
||||
root = pkgs.site-max;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue