2023-10-29 17:28:20 +01:00
|
|
|
{ depot, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
|
|
|
|
|
2023-10-29 18:39:21 +01:00
|
|
|
# assumes `name` is configured appropriately in your .ssh/config
|
|
|
|
deployScript = name: sys: pkgs.writeShellScriptBin "deploy-${name}" ''
|
|
|
|
set -eo pipefail
|
|
|
|
nix copy --no-check-sigs --to ssh-ng://${name} ${sys}
|
|
|
|
ssh ${name} nix-env --profile /nix/var/nix/profiles/system --set ${sys}
|
|
|
|
ssh ${name} ${sys}/bin/switch-to-configuration switch
|
|
|
|
'';
|
|
|
|
|
2023-10-29 17:28:20 +01:00
|
|
|
in
|
2023-10-30 10:57:12 +01:00
|
|
|
depot.nix.readTree.drvTargets rec {
|
2023-10-29 18:28:07 +01:00
|
|
|
archeologySystem = (depot.ops.nixos.nixosFor ({ ... }: {
|
2023-10-29 17:28:20 +01:00
|
|
|
imports = [
|
|
|
|
./archeology/configuration.nix
|
|
|
|
];
|
|
|
|
})).config.system.build.toplevel;
|
2023-10-29 18:39:21 +01:00
|
|
|
|
2023-10-30 10:21:26 +01:00
|
|
|
archeologyEc2System = (depot.ops.nixos.nixosFor ({ ... }: {
|
|
|
|
imports = [
|
|
|
|
./archeology-ec2/configuration.nix
|
|
|
|
];
|
|
|
|
})).config.system.build.toplevel;
|
|
|
|
|
2023-10-29 18:39:21 +01:00
|
|
|
shell = pkgs.mkShell {
|
|
|
|
name = "flokli-nixos-shell";
|
|
|
|
packages = [
|
|
|
|
(deployScript "archeology" archeologySystem)
|
2023-10-30 10:21:26 +01:00
|
|
|
(deployScript "archeology-ec2" archeologyEc2System)
|
2023-10-29 18:39:21 +01:00
|
|
|
];
|
|
|
|
};
|
2023-10-29 17:28:20 +01:00
|
|
|
}
|