From f8026b6e4c869aa108f6361c8ccd50890657994d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 18 May 2019 10:49:00 +0200 Subject: Move personal websites to modules --- .../websites/capitaines/mastodon_static/index.html | 29 +++++++++++++ .../websites/capitaines/mastodon_static/oops.png | Bin 0 -> 120305 bytes modules/private/websites/capitaines/production.nix | 47 +++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 modules/private/websites/capitaines/mastodon_static/index.html create mode 100644 modules/private/websites/capitaines/mastodon_static/oops.png create mode 100644 modules/private/websites/capitaines/production.nix (limited to 'modules/private/websites/capitaines') diff --git a/modules/private/websites/capitaines/mastodon_static/index.html b/modules/private/websites/capitaines/mastodon_static/index.html new file mode 100644 index 0000000..fae4152 --- /dev/null +++ b/modules/private/websites/capitaines/mastodon_static/index.html @@ -0,0 +1,29 @@ + + + + + This instance is now closed - Mastodon + + + +
+ Mastodon +

Sorry, this instance is closed now.

+
+ + diff --git a/modules/private/websites/capitaines/mastodon_static/oops.png b/modules/private/websites/capitaines/mastodon_static/oops.png new file mode 100644 index 0000000..0abddad Binary files /dev/null and b/modules/private/websites/capitaines/mastodon_static/oops.png differ diff --git a/modules/private/websites/capitaines/production.nix b/modules/private/websites/capitaines/production.nix new file mode 100644 index 0000000..fe9c619 --- /dev/null +++ b/modules/private/websites/capitaines/production.nix @@ -0,0 +1,47 @@ +{ lib, pkgs, config, myconfig, ... }: +let + cfg = config.myServices.websites.capitaines.production; + env = myconfig.env.websites.capitaines; + webappName = "capitaines_mastodon"; + root = "/run/current-system/webapps/${webappName}"; + siteDir = ./mastodon_static; +in { + options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; + + config = lib.mkIf cfg.enable { + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${siteDir} $out/webapps/${webappName} + ''; + + services.websites.production.vhostConfs.capitaines_mastodon = { + certName = "capitaines"; + certMainHost = "mastodon.capitaines.fr"; + hosts = [ "mastodon.capitaines.fr" ]; + root = root; + extraConfig = [ + '' + ErrorDocument 404 /index.html + + DirectoryIndex index.html + Options Indexes FollowSymLinks MultiViews Includes + Require all granted + + '' + ]; + }; + + services.websites.production.vhostConfs.capitaines = { + certName = "capitaines"; + addToCerts = true; + hosts = [ "capitaines.fr" ]; + root = "/run/current-system/webapps/_www"; + extraConfig = [ '' + + DirectoryIndex index.htm + Require all granted + + '' ]; + }; + }; +} -- cgit v1.2.3