Skip to content

Commit

Permalink
arcade cabinets: add offline services to systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
disassembler committed Aug 14, 2024
1 parent f94ebe4 commit 884ede0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions flake/colmena.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,46 @@
};
};
};
systemd.services = {
hydra-offline = {
environment = {
LOCAL_HYDRA = "1";
};
wantedBy = ["multi-user.target" "hydra-control-plane.service"];
startLimitIntervalSec = 0;
serviceConfig = {
ExecStart = "${self.packages.${system}.hydra-offline-wrapper}/bin/hydra-offline-wrapper";
Restart = "always";
RestartSec = "30s";
WorkingDirectory = "/var/lib/hydra-offline";
StateDirectory = "hydra-offline";
User = "hydra-offline";
Group = "hydra-offline";
};
};
hydra-control-plane = {
environment = {
LOCAL_HYDRA = "1";
};
wantedBy = ["multi-user.target"];
startLimitIntervalSec = 10;
serviceConfig = {
ExecStart = "${self.packages.${system}.hydra-control-plane-wrapper}/bin/hydra-control-plane-wrapper";
Restart = "always";
RestartSec = "30s";
WorkingDirectory = "/var/lib/hydra-offline";
User = "hydra-offline";
Group = "hydra-offline";
};
};
};
users.groups.hydra-offline.gid = 10016;
users.users.hydra-offline = {
description = "hydra offline user";
uid = 10016;
group = "hydra-offline";
isSystemUser = true;
};
};
baseConfig = { pkgs, ...}: {
boot = {
Expand Down
2 changes: 1 addition & 1 deletion perSystem/packages/wrappers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
};
hydra-offline-wrapper = pkgs.writeShellApplication {
name = "hydra-offline-wrapper";
runtimeInputs = [ config.packages.cardano-node config.packages.cardano-cli pkgs.jq ];
runtimeInputs = [ config.packages.cardano-node config.packages.cardano-cli pkgs.jq pkgs.curl ];
text = ''
export LOCAL_HYDRA="''${LOCAL_HYDRA:-0}"
if [ "''${LOCAL_HYDRA}" -eq 0 ]; then
Expand Down

0 comments on commit 884ede0

Please sign in to comment.