initial(ish) commit
This commit is contained in:
commit
b744693f0e
88 changed files with 4925 additions and 0 deletions
26
nixos-modules/services/unifi.nix
Normal file
26
nixos-modules/services/unifi.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.ragon.services.unifi;
|
||||
domain = config.ragon.services.nginx.domain;
|
||||
in
|
||||
{
|
||||
options.ragon.services.unifi.enable = lib.mkEnableOption "Enables the unifi console";
|
||||
options.ragon.services.unifi.domainPrefix =
|
||||
lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "unifi";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.unifi = {
|
||||
enable = true;
|
||||
};
|
||||
services.nginx.virtualHosts."${cfg.domainPrefix}.${domain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "${domain}";
|
||||
locations."/".proxyPass = "https://127.0.0.1:8443";
|
||||
};
|
||||
ragon.persist.extraDirectories = [
|
||||
"/var/lib/unifi"
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue