forked from jakehamilton/config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
34 lines (28 loc) · 857 Bytes
/
default.nix
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
{ lib, pkgs, config, ... }:
let
inherit (lib) mkIf mkEnableOption fetchFromGitHub;
inherit (lib.internal) mkOpt;
cfg = config.plusultra.services.websites.sokoban;
in
{
options.plusultra.services.websites.sokoban = with lib.types; {
enable = mkEnableOption "Sokoban Website";
package = mkOpt package pkgs.plusultra.sokoban-website "The site package to use.";
domain = mkOpt str "sokoban.app" "The domain to serve the website site on.";
acme = {
enable = mkOpt bool true "Whether or not to automatically fetch and configure SSL certs.";
};
};
config = mkIf cfg.enable {
services.nginx = {
enable = true;
virtualHosts.${cfg.domain} = {
enableACME = cfg.acme.enable;
forceSSL = cfg.acme.enable;
locations."/" = {
root = cfg.package;
};
};
};
};
}