tvl-depot/users/flokli/nixos/default.nix
Florian Klink 52a8e47ac1 feat(users/flokli/nixos/nixos-tvix-cache): init
This is a fetch-through mirror of cache.nixos.org, hosted by NumTide.

The current machine is a SX65 Hetzner dedicated server with 4x22TB SATA disks,
and 2x1TB NVMe disks.

The goals of this machine:

 - Exercise tvix-store and nar-bridge code
 - Collect usage metrics (see https://nixos.tvix.store/grafana)
 - Identify bottlenecks
 - Replace cache.nixos.org?

Be however aware that there's zero availability guarantees. Since Tvix doesn't
support garbage collection yet, we either will delete data or order a bigger
box.

Change-Id: Id24baa18cae1629a06caaa059c0c75d4a01659d5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12811
Tested-by: BuildkiteCI
Reviewed-by: Jonas Chevalier <zimbatm@zimbatm.com>
Reviewed-by: flokli <flokli@flokli.de>
2024-11-23 09:40:21 +00:00

41 lines
1.2 KiB
Nix

{ depot, pkgs, lib, ... }:
let
systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
# assumes `name` is configured appropriately in your .ssh/config
deployScript = name: sys: pkgs.writeShellScriptBin "deploy-${name}" ''
set -eo pipefail
nix-copy-closure --to ${name} --gzip --use-substitutes ${sys}
ssh ${name} nix-env --profile /nix/var/nix/profiles/system --set ${sys}
ssh ${name} ${sys}/bin/switch-to-configuration switch
'';
in
depot.nix.readTree.drvTargets rec {
archeologyEc2System = (depot.ops.nixos.nixosFor ({ ... }: {
imports = [
./archeology-ec2/configuration.nix
];
})).config.system.build.toplevel;
deploy-archeology-ec2 = (deployScript "archeology-ec2" archeologyEc2System);
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);
deps = (depot.nix.lazy-deps {
deploy-archeology-ec2.attr = "users.flokli.nixos.deploy-archeology-ec2";
aws.attr = "third_party.nixpkgs.awscli";
});
shell = pkgs.mkShell {
name = "flokli-nixos-shell";
packages = [ deps ];
};
}