Add home page config

This commit is contained in:
Tim Schubert 2020-12-30 23:48:33 +01:00
parent 161b87184c
commit 3e26cdf43f
No known key found for this signature in database
GPG key ID: 99658A3EB5CD7C13
4 changed files with 36 additions and 0 deletions

23
modules/homepage.nix Normal file
View file

@ -0,0 +1,23 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.homePage;
homePage = import (builtins.fetchTarball {
url = "https://github.com/dadada/dadada.li/archive/cb85ed00594f1d4396fe3f61f92e0ff19595596d.tar.gz";
sha256 = "176l913xsg9gicglkmpmnqwjn8r0psyyj2vx5pi26v0angnfg80a";
});
in {
options.dadada.homePage = {
enable = mkEnableOption "Enable home page";
};
config = mkIf cfg.enable {
services.nginx.enable = true;
services.nginx.virtualHosts."dadada.li" = {
enableACME = true;
forceSSL = true;
root = homePage;
};
};
}