X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fnath%2Fvillon.nix;fp=modules%2Fprivate%2Fwebsites%2Fnath%2Fvillon.nix;h=57a1df574162d364535e013fd2e0fc804851e3ef;hb=87949cb97f78dad19743352a584af432a4800e03;hp=0000000000000000000000000000000000000000;hpb=c081a03a97780afd845e017f279e0f1e96a86c8a;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/nath/villon.nix b/modules/private/websites/nath/villon.nix new file mode 100644 index 0000000..57a1df5 --- /dev/null +++ b/modules/private/websites/nath/villon.nix @@ -0,0 +1,42 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.myServices.websites.nath.villon; + varDir = "/var/lib/ftp/nath"; + env = config.myEnv.websites.nath; + domain = "sntvillon.immae.eu"; + apacheUser = config.services.httpd.Prod.user; + apacheGroup = config.services.httpd.Prod.group; +in { + options.myServices.websites.nath.villon.enable = lib.mkEnableOption "enable Nath's website"; + + config = lib.mkIf cfg.enable { + services.webstats.sites = [ { name = domain; } ]; + + system.activationScripts.nath_villon = { + deps = [ "users" ]; + text = '' + install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir} + ''; + }; + security.acme.certs."ftp".extraDomains."${domain}" = null; + + services.websites.env.production.vhostConfs.nath_villon = { + certName = "nath"; + certMainHost = domain; + hosts = [ domain ]; + root = varDir; + extraConfig = [ + '' + Use Stats ${domain} + + + DirectoryIndex index.htm index.html + Options Indexes FollowSymLinks MultiViews Includes + AllowOverride None + Require all granted + + '' + ]; + }; + }; +}