Hendrik Sokolowski
6c7d9704bd
All checks were successful
continuous-integration/drone/push Build is passing
64 lines
1.3 KiB
Nix
64 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
psCfg = config.pub-solar;
|
|
cfg = config.pub-solar.concourse-server;
|
|
in {
|
|
options.pub-solar.concourse-server = {
|
|
enable = mkOption {
|
|
description = "Concourse server";
|
|
default = false;
|
|
};
|
|
|
|
hostStateDir = mkOption {
|
|
description = "sets the state directory on host side";
|
|
default = "/srv/concourse-server/data";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
containers."concourse-server" = {
|
|
autoStart = true;
|
|
ephemeral = true;
|
|
bindMounts."/data" = {
|
|
hostPath = cfg.hostStateDir;
|
|
isReadOnly = false;
|
|
};
|
|
|
|
config = {
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
nixpkgs.overlays = [ (self: super: {
|
|
concourse = self.pkgs.concourse;
|
|
}) ];
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
networking.firewall.enable = false;
|
|
|
|
services.postgresql = {
|
|
enable = true;
|
|
};
|
|
|
|
systemd.services.concourse-web = {
|
|
enable = true;
|
|
description = "concourse web";
|
|
unitConfig = {
|
|
Type = "simple";
|
|
};
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.concourse}/bin/concourse";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|