nixos-config/configs/workhorse/lektor-techblog.nix
2019-10-24 02:24:33 +02:00

55 lines
1.2 KiB
Nix

{ config, pkgs, lib, ... }:
let
containerName = "techblog";
port = 5002;
repository = "ssh://gogs@git.ingolf-wagner.de:443/palo/tech.ingolf-wagner.de.git";
sshKey = toString <secrets/lektor/techblog>;
in {
services.nginx = {
enable = true;
statusPage = true;
virtualHosts = {
"${containerName}.${config.networking.hostName}.private" = {
serverAliases = [];
locations."/" = {
proxyPass = "http://${config.networking.hostName}.private:${toString port}";
};
};
};
};
containers.${containerName} = {
bindMounts = {
"/var/src" = {
hostPath = toString "/var/src/";
isReadOnly = true;
};
};
autoStart = true;
config =
{ config, pkgs, ... }:
{
imports = [ <system/all> ];
services.lektor = {
enable = true;
host = "git.ingolf-wagner.de";
sshKey = sshKey;
repository = repository;
port = port;
additionalScript = pkgs.writeScript "build" "${pkgs.nix}/bin/nix-shell --run build";
};
};
};
# it might take some time will this thing is up
systemd.services."container@${containerName}".serviceConfig.TimeoutStartSec = lib.mkForce "infinity";
}