nixos-config/configs/workhorse/lektor-gaykraft.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
let
containerName = "gaykraft";
port = 5001;
repository = "ssh://gogs@git.ingolf-wagner.de:443/palo/gaykraft.git";
sshKey = toString <secrets/lektor/gaykraft>;
in {
services.nginx = {
enable = true;
statusPage = true;
virtualHosts = {
"${containerName}.${config.networking.hostName}.private" = {
2019-12-20 05:54:26 +01:00
serverAliases = [ ];
2019-10-24 02:20:38 +02:00
locations."/" = {
2019-12-20 05:54:26 +01:00
proxyPass =
"http://${config.networking.hostName}.private:${toString port}";
2019-10-24 02:20:38 +02:00
};
};
};
};
containers.${containerName} = {
bindMounts = {
"/var/src" = {
hostPath = toString "/var/src/";
isReadOnly = true;
};
};
autoStart = true;
2019-12-20 05:54:26 +01:00
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";
2019-10-24 02:20:38 +02:00
};
2019-12-20 05:54:26 +01:00
};
2019-10-24 02:20:38 +02:00
};
# it might take some time will this thing is up
2019-12-20 05:54:26 +01:00
systemd.services."container@${containerName}".serviceConfig.TimeoutStartSec =
lib.mkForce "infinity";
2019-10-24 02:20:38 +02:00
}