nixos-config/configs/workhorse/lektor-terranix.nix
2019-12-20 17:54:26 +13:00

55 lines
1.2 KiB
Nix

{ config, pkgs, lib, ... }:
let
containerName = "terranix";
port = 5003;
repository = "ssh://gogs@git.ingolf-wagner.de:443/terranix/terranix.org.git";
sshKey = toString <secrets/lektor/terranix>;
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";
}