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
|
2023-10-30 11:05:11 +01:00
|
|
|
nix-copy-closure --to ${name} --gzip --use-substitutes ${sys}
|
2023-10-29 18:39:21 +01:00
|
|
|
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-30 10:21:26 +01:00
|
|
|
archeologyEc2System = (depot.ops.nixos.nixosFor ({ ... }: {
|
|
|
|
imports = [
|
|
|
|
./archeology-ec2/configuration.nix
|
|
|
|
];
|
|
|
|
})).config.system.build.toplevel;
|
|
|
|
|
2023-10-30 11:21:30 +01:00
|
|
|
deploy-archeology-ec2 = (deployScript "archeology-ec2" archeologyEc2System);
|
|
|
|
|
2024-11-19 15:30:01 +01:00
|
|
|
nixosTvixCacheSystem = (depot.ops.nixos.nixosFor ({ ... }: {
|
|
|
|
imports = [
|
|
|
|
./nixos-tvix-cache/configuration.nix
|
|
|
|
];
|
|
|
|
})).config.system.build.toplevel;
|
|
|
|
|
|
|
|
deploy-nixos-tvix-cache = (deployScript "root@nixos.tvix.store" nixosTvixCacheSystem);
|
|
|
|
|
2023-10-30 15:21:16 +01:00
|
|
|
deps = (depot.nix.lazy-deps {
|
|
|
|
deploy-archeology-ec2.attr = "users.flokli.nixos.deploy-archeology-ec2";
|
2024-08-28 17:55:26 +02:00
|
|
|
aws.attr = "third_party.nixpkgs.awscli";
|
2023-10-30 15:21:16 +01:00
|
|
|
});
|
|
|
|
|
2023-10-29 18:39:21 +01:00
|
|
|
shell = pkgs.mkShell {
|
|
|
|
name = "flokli-nixos-shell";
|
2023-10-30 15:21:16 +01:00
|
|
|
packages = [ deps ];
|
2023-10-29 18:39:21 +01:00
|
|
|
};
|
2023-10-29 17:28:20 +01:00
|
|
|
}
|