diff --git a/lib/fudo/acme-for-hostname.nix b/lib/fudo/acme-for-hostname.nix deleted file mode 100644 index 0451170..0000000 --- a/lib/fudo/acme-for-hostname.nix +++ /dev/null @@ -1,69 +0,0 @@ -# Starts an Nginx server on $HOSTNAME just to get a cert for this host - -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.fudo.acme; - - # wwwRoot = hostname: - # pkgs.writeTextFile { - # name = "index.html"; - - # text = '' - # - # - # ${hostname} - # - # - #

${hostname} - # - # - # ''; - # destination = "/www"; - # }; - -in { - - options.fudo.acme = { - enable = mkEnableOption "Fetch ACME certs for supplied local hostnames."; - - hostnames = mkOption { - type = with types; listOf str; - description = "A list of hostnames mapping to this host, for which to acquire SSL certificates."; - default = []; - example = [ - "my.hostname.com" - "alt.hostname.com" - ]; - }; - - admin-address = mkOption { - type = types.str; - description = "The admin address in charge of these addresses."; - default = "admin@fudo.org"; - }; - }; - - config = mkIf cfg.enable { - - services.nginx = { - enable = true; - - virtualHosts = listToAttrs - (map - (hostname: - nameValuePair hostname - { - enableACME = true; - forceSSL = true; - # root = (wwwRoot hostname) + ("/" + "www"); - }) - cfg.hostnames); - }; - - security.acme.certs = listToAttrs - (map (hostname: nameValuePair hostname { email = cfg.admin-address; }) - cfg.hostnames); - }; -} diff --git a/lib/fudo/default.nix b/lib/fudo/default.nix index 0d159d7..3472697 100644 --- a/lib/fudo/default.nix +++ b/lib/fudo/default.nix @@ -3,7 +3,6 @@ with lib; { imports = [ ./acme-certs.nix - ./acme-for-hostname.nix ./authentication.nix ./backplane ./chat.nix