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 Jul 31, 2024
1 parent 44f658b commit a0a9fb1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 60 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/darwin.yml

This file was deleted.

31 changes: 31 additions & 0 deletions dev/effect-deploy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ self, withSystem, ... }:
{
herculesCI =
{ config, ... }:
withSystem "x86_64-linux" (
{ hci-effects, ... }:
let
secretsMap.ssh-deployment = "ssh-deployment";
userSetupScript = ''
writeSSHKey ssh-deployment
cat >>~/.ssh/known_hosts <<EOF
${self.nixosConfigurations.build01.config.environment.etc."ssh/ssh_known_hosts".text}
EOF
'';
in
{
onPush.default.outputs.effects = hci-effects.runIf (config.repo.ref == "refs/heads/master") {
darwin01 = hci-effects.runNixDarwin {
ssh.destination = "[email protected]";
configuration = self.darwinConfigurations.darwin01;
inherit secretsMap userSetupScript;
};
darwin02 = hci-effects.runNixDarwin {
ssh.destination = "[email protected]";
configuration = self.darwinConfigurations.darwin02;
inherit secretsMap userSetupScript;
};
};
}
);
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
systems = import inputs.systems;

imports = [
./dev/effect-deploy.nix
inputs.hercules-ci-effects.flakeModule
inputs.treefmt-nix.flakeModule
];
Expand Down

0 comments on commit a0a9fb1

Please sign in to comment.