2024-07-21 23:55:27 +00:00
|
|
|
{ pkgs, lib, ... }: {
|
2024-07-19 16:25:12 +00:00
|
|
|
fileSystems."/nvme" = {
|
|
|
|
device = "/dev/nvme0n1";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
security.acme.defaults.email = "experiments@lahfa.xyz";
|
2024-07-19 11:08:52 +00:00
|
|
|
services.tvix-binary-cache = {
|
|
|
|
enable = true;
|
2024-07-21 23:55:27 +00:00
|
|
|
|
2024-07-19 16:25:12 +00:00
|
|
|
enableNginx = true;
|
|
|
|
nginx = {
|
|
|
|
clientMaxBodySize = "50G";
|
|
|
|
host = "binary-cache";
|
|
|
|
};
|
2024-07-24 08:25:26 +00:00
|
|
|
castoreDir = "/nvme";
|
2024-07-19 11:08:52 +00:00
|
|
|
caches = {
|
2024-07-19 16:25:12 +00:00
|
|
|
forkos = {
|
2024-07-21 23:55:27 +00:00
|
|
|
grpcListenAddress = "[::1]:5000";
|
|
|
|
narBridgeListenAddress = "[::1]:8000";
|
|
|
|
tvix-daemon-composition.pathinfoservices = {
|
|
|
|
sled = {
|
|
|
|
type = "sled";
|
|
|
|
is_temporary = false;
|
|
|
|
path = "/var/lib/tvix-daemon-forkos/pathinfos.sled";
|
|
|
|
};
|
2024-07-24 08:25:26 +00:00
|
|
|
nix = {
|
2024-07-21 23:55:27 +00:00
|
|
|
type = "nix";
|
2024-07-24 08:25:26 +00:00
|
|
|
base_url = "https://bagel-cache.s3-web.delroth.net";
|
|
|
|
blob_service = "default";
|
|
|
|
directory_service = "objectstore";
|
|
|
|
};
|
|
|
|
default = lib.mkForce {
|
|
|
|
type = "cache";
|
|
|
|
near = "sled";
|
|
|
|
far = "nix";
|
2024-07-21 23:55:27 +00:00
|
|
|
};
|
|
|
|
};
|
2024-07-19 16:25:12 +00:00
|
|
|
};
|
|
|
|
cno = {
|
2024-07-21 23:55:27 +00:00
|
|
|
grpcListenAddress = "[::1]:5001";
|
|
|
|
narBridgeListenAddress = "[::1]:8001";
|
|
|
|
tvix-daemon-composition.pathinfoservices = {
|
|
|
|
sled = {
|
|
|
|
type = "sled";
|
|
|
|
is_temporary = false;
|
|
|
|
path = "/var/lib/tvix-daemon-cno/pathinfos.sled";
|
|
|
|
};
|
2024-07-24 08:25:26 +00:00
|
|
|
nix = {
|
2024-07-21 23:55:27 +00:00
|
|
|
type = "nix";
|
2024-07-24 08:25:26 +00:00
|
|
|
base_url = "https://cache.nixos.org?trusted-public-keys=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
|
|
|
|
blob_service = "default";
|
|
|
|
directory_service = "objectstore";
|
|
|
|
};
|
|
|
|
default = lib.mkForce {
|
|
|
|
type = "cache";
|
|
|
|
near = "sled";
|
|
|
|
far = "nix";
|
2024-07-21 23:55:27 +00:00
|
|
|
};
|
|
|
|
};
|
2024-07-19 16:25:12 +00:00
|
|
|
};
|
2024-07-19 11:08:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-19 16:25:12 +00:00
|
|
|
services.nginx.virtualHosts.binary-cache = {
|
|
|
|
enableACME = true;
|
2024-07-20 18:10:56 +00:00
|
|
|
forceSSL = true;
|
2024-07-19 16:25:12 +00:00
|
|
|
default = true;
|
|
|
|
serverName = "tvix.store";
|
|
|
|
serverAliases = [
|
|
|
|
"cache.nixos.sh"
|
|
|
|
];
|
2024-07-24 08:25:26 +00:00
|
|
|
locations."/".proxyPass = "http://[::1]:5000";
|
2024-07-19 16:25:12 +00:00
|
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ broot tree iotop glances htop ];
|
2024-07-19 11:08:52 +00:00
|
|
|
}
|