dotfiles/nixos/services/website.nix

30 lines
624 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
cfg = config.services.yorick.website;
2021-05-29 18:05:31 +02:00
in with lib; {
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; };
2021-05-29 18:05:31 +02:00
pkg = mkOption {
type = types.package;
2021-05-30 11:47:17 +02:00
default = pkgs.yori-cc;
2021-05-29 18:05:31 +02:00
};
2017-02-02 16:58:48 +01:00
};
2021-05-29 18:05:31 +02:00
redirect = mkOption {
type = types.loaOf types.str;
default = [ ];
2017-02-02 16:58:48 +01:00
};
};
2021-05-29 18:05:31 +02: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
}