54 lines
1.2 KiB
Nix
54 lines
1.2 KiB
Nix
{ 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" = {
|
|
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";
|
|
|
|
}
|