summaryrefslogtreecommitdiff
path: root/modules/blog.nix
diff options
context:
space:
mode:
authorLeonardo Santiago <[email protected]>2024-10-28 08:05:42 -0300
committerLeonardo Santiago <[email protected]>2024-10-28 08:05:42 -0300
commit4842e81317e9815540d559d689be51d13191e1e4 (patch)
treed1b97123d3aaea731544e238d89af3e1ccfe9d29 /modules/blog.nix
parentfbbf34c7b6ba70a718abf655c0711b6ac5ff20e8 (diff)
change files to web-services in order to share some code.
Diffstat (limited to 'modules/blog.nix')
-rw-r--r--modules/blog.nix37
1 files changed, 0 insertions, 37 deletions
diff --git a/modules/blog.nix b/modules/blog.nix
deleted file mode 100644
index c186513..0000000
--- a/modules/blog.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ config, lib, inputs, pkgs, ... }: with lib; let
- cfg = config.santi-modules.services.blog;
- blog = pkgs.stdenv.mkDerivation {
- name="hugo-blog";
- src = inputs.blog;
- buildInputs = [ pkgs.hugo ];
- buildPhase = ''
- mkdir $out
- hugo --destination $out
- '';
- };
-in {
- options.santi-modules.services.blog = {
- enable = mkEnableOption "Enable blog hosting";
- url = mkOption {
- type = types.str;
- default = "santi.net.br";
- description = "Url to serve blog on";
- };
- };
- config = mkIf cfg.enable {
- networking.firewall.allowedTCPPorts = [ 80 443 ];
- # TODO: enable SSL
- services.nginx = {
- enable = true;
- virtualHosts.${cfg.url} = {
- addSSL = true;
- enableACME = true;
- root = blog;
- };
- };
- security.acme = {
- acceptTerms = true;
- certs.${cfg.url}.email = "[email protected]";
- };
- };
-}