-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.nix
More file actions
34 lines (30 loc) · 772 Bytes
/
module.nix
File metadata and controls
34 lines (30 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ pkgs, lib, config, ... }:
let
cfg = config.services.gergle;
in
{
options.services.gergle = {
enable = lib.mkEnableOption "Enable the gergle service";
package = lib.mkPackageOption pkgs "gergle-web-wasm" {
example = "gergle-web-debug";
};
virtualHost = lib.mkOption {
type = lib.types.str;
example = "gergle.example.com";
description = "Virtual host to serve gergle on";
};
location = lib.mkOption {
type = lib.types.str;
default = "/";
description = "Location to serve gergle on";
};
};
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
virtualHosts."${cfg.virtualHost}" = {
locations.${cfg.location}.root = "${cfg.package}/";
};
};
};
}