{ 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" ]; }; }; }; }; }