my Nix configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

website.nix 627B

12345678910111213141516171819202122232425
  1. { config, lib, pkgs, ... }:
  2. let
  3. yoricc = pkgs.callPackage ../packages/yori-cc.nix {};
  4. cfg = config.services.yorick.website;
  5. in
  6. with lib;
  7. {
  8. options.services.yorick = {
  9. website = {
  10. enable = mkEnableOption "yoricc website";
  11. vhost = mkOption { type = types.string; };
  12. pkg = mkOption { type = types.package; default = yoricc; };
  13. };
  14. redirect = mkOption { type = types.loaOf types.string; default = []; };
  15. };
  16. config.services.nginx.virtualHosts = with cfg; mkIf enable {
  17. ${vhost} = {
  18. enableACME = true;
  19. forceSSL = true;
  20. locations."/".root = "${pkg}/web";
  21. };
  22. };
  23. }