Skip to content

Commit

Permalink
switch to effect for darwin ssh deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
zowoq committed Dec 27, 2023
1 parent 1abf777 commit ec1bd80
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 62 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/darwin.yml

This file was deleted.

36 changes: 36 additions & 0 deletions dev/effect.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{ self, withSystem, ... }:
{
herculesCI = { config, ... }:
withSystem "x86_64-linux" ({ hci-effects, lib, ... }:
{
onPush.default.outputs.effects = {
darwin = hci-effects.runIf (lib.hasPrefix "refs/heads/gh-readonly-queue/master/" config.repo.ref)
(hci-effects.runNixDarwin
{
ssh.destination = "[email protected]";
configuration = self.darwinConfigurations.darwin02;
buildOnDestination = true;
secretsMap.ssh-deployment = "ssh-deployment";
userSetupScript = ''
writeSSHKey ssh-deployment
cat >>~/.ssh/known_hosts <<EOF
darwin02.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJqwpMUEl1/iwrBakeDb1rlheXlE5mfDLICVz8w6yi6
EOF
'';
}
{
ssh.destination = "[email protected]";
configuration = self.darwinConfigurations.darwin03;
buildOnDestination = true;
secretsMap.ssh-deployment = "ssh-deployment";
userSetupScript = ''
writeSSHKey ssh-deployment
cat >>~/.ssh/known_hosts <<EOF
darwin03.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKX7W1ztzAtVXT+NBMITU+JLXcIE5HTEOd7Q3fQNu80S
EOF
'';
});
};
}
);
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
imports = [
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
./dev/effect.nix
];

perSystem = { config, inputs', lib, pkgs, self', system, ... }:
Expand Down

0 comments on commit ec1bd80

Please sign in to comment.