dotfiles/nixos/services/website.nix

26 lines
621 B
Nix
Raw Normal View History

2017-02-02 16:58:48 +01:00
{ config, lib, pkgs, ... }:
let
2018-03-11 18:28:25 +01:00
yoricc = pkgs.callPackage ../packages/yori-cc.nix {};
cfg = config.services.yorick.website;
2017-02-02 16:58:48 +01:00
in
2018-03-11 18:28:25 +01:00
with lib;
2017-02-02 16:58:48 +01:00
{
2018-03-11 18:28:25 +01:00
options.services.yorick = {
website = {
enable = mkEnableOption "yoricc website";
2020-05-21 17:39:38 +02:00
vhost = mkOption { type = types.str; };
2018-03-11 18:28:25 +01:00
pkg = mkOption { type = types.package; default = yoricc; };
2017-02-02 16:58:48 +01:00
};
2020-05-21 17:39:38 +02:00
redirect = mkOption { type = types.loaOf types.str; default = []; };
2018-03-11 18:28:25 +01:00
};
config.services.nginx.virtualHosts = with cfg; mkIf enable {
${vhost} = {
enableACME = true;
forceSSL = true;
locations."/".root = "${pkg}/web";
2017-02-02 16:58:48 +01:00
};
};
}