summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2017-06-02 08:12:27 -0400
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2017-06-02 08:12:27 -0400
commitb72b0e332b7a930001e598cdd006ab10b868b2c8 (patch)
tree5a5df0d72a24122326e774ea3c5398286543c80b /config
parent5ced370c7da1ac362080aa126bc0f10ca166f8cb (diff)
hydra: Generate key to use for binary cache.
Diffstat (limited to 'config')
-rw-r--r--config/hydra.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/config/hydra.nix b/config/hydra.nix
index 11fc806..2d6dd41 100644
--- a/config/hydra.nix
+++ b/config/hydra.nix
@@ -11,7 +11,29 @@ in
notificationSender = "kj+hydra@orbekk.com";
port = hydraPort;
};
-
+
+ systemd.services.hydra-manual-setup = {
+ description = "Create Keys for Hydra";
+ serviceConfig.Type = "oneshot";
+ serviceConfig.RemainAfterExit = true;
+ wantedBy = [ "multi-user.target" ];
+ requires = [ "hydra-init.service" ];
+ after = [ "hydra-init.service" ];
+ environment = config.systemd.services.hydra-init.environment;
+ script = ''
+ if [ ! -e ~hydra/.setup-is-complete ]; then
+ # create signing keys
+ /run/current-system/sw/bin/install -d -m 551 /opt/secret/hydra_key/hydra.orbekk.com-1
+ /run/current-system/sw/bin/nix-store --generate-binary-cache-key hydra.orbekk.com-1 /opt/secret/hydra_key/hydra.orbekk.com-1/secret /opt/secret/hydra_key/hydra.orbekk.com-1/public
+ /run/current-system/sw/bin/chown -R hydra:hydra /opt/secret/hydra_key
+ /run/current-system/sw/bin/chmod 440 /etc/nix/hydra.iohk.io-1/secret
+ /run/current-system/sw/bin/chmod 444 /etc/nix/hydra.iohk.io-1/public
+ # done
+ touch ~hydra/.setup-is-complete
+ fi
+ '';
+ };
+
nix = {
distributedBuilds = true;
nrBuildUsers = 30;