feat(nix): Add Gemma example deployment

This commit is contained in:
Vincent Ambo 2018-01-03 23:02:34 +01:00
parent 9464a1dee4
commit a6a48806c4
3 changed files with 99 additions and 0 deletions

View file

@ -14,6 +14,11 @@ blogConfig = {
proxyPass = "http://127.0.0.1:8000";
};
};
gemma = import ./pkgs/gemma.nix { inherit pkgs; };
gemmaConfig = writeTextFile {
name = "config.lisp";
text = builtins.readFile ./gemma-config.lisp;
};
in {
# Ensure that blog software is installed
environment.systemPackages = [
@ -47,6 +52,18 @@ in {
rootUrl = "https://git.tazj.in/";
};
# Set up Gemma
systemd.services.gemma = {
description = "Recurring task tracking app";
script = "${gemma}/bin/gemma";
serviceConfig.Restart = "always";
wantedBy = [ "multi-user.target" ];
environment = {
GEMMA_CONFIG = "${gemmaConfig}";
};
};
# Set up reverse proxy
services.nginx = {
enable = true;
@ -72,5 +89,14 @@ in {
forceSSL = true;
extraConfig = "return 302 https://www.google.com/maps/d/viewer?mid=1pJIYY9cuEdt9DuMTbb4etBVq7hs;";
};
# Gemma demo instance!
virtualHosts."gemma.tazj.in" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:4242";
};
};
};
}