chore: more work & more explain
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
5cc202ecca
commit
104c58e01e
20
README.md
20
README.md
|
@ -1,3 +1,21 @@
|
|||
# The portable binary cache
|
||||
# The portable binary cache
|
||||
|
||||
This is an experiment of a portable binary cache with deduplication via Tvix.
|
||||
|
||||
Currently hosted in Bornhack.
|
||||
|
||||
## `cache.nixos.org`
|
||||
|
||||
```nix
|
||||
nix.settings.substituters = [ "https://tvix.store/cno/" ];
|
||||
nix.settings.trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" ];
|
||||
```
|
||||
|
||||
## 🌶️ `cache.forkos.org` 🌶️
|
||||
|
||||
Don't ask what is this.
|
||||
|
||||
```nix
|
||||
nix.settings.substituters = [ "https://tvix.store/forkos/" ];
|
||||
nix.settings.trusted-public-keys = [ "cache.forkos.org:xfXIUJO1yiEITJmYsVmNDa9BFSlgTh/YqZ+4ei1EhQg=" ];
|
||||
```
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
networking.hostName = "tvix-binary-cache"; # Define your hostname.
|
||||
users.users.root.openssh.authorizedKeys.keyFiles = [ ./raito.keys ];
|
||||
users.users.root.openssh.authorizedKeys.keyFiles = [ ./raito.keys ./sinavir.keys ];
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Paris";
|
||||
|
||||
|
|
1
binary-cache/sinavir.keys
Normal file
1
binary-cache/sinavir.keys
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEpwF+XD3HgX64kqD42pcEZRNYAWoO4YNiOm5KO4tH6o
|
|
@ -1,24 +1,48 @@
|
|||
{ config, ... }: {
|
||||
{ pkgs, ... }: {
|
||||
fileSystems."/nvme" = {
|
||||
device = "/dev/nvme0n1";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
security.acme.acceptTerms = true;
|
||||
security.acme.defaults.email = "experiments@lahfa.xyz";
|
||||
services.tvix-binary-cache = {
|
||||
enable = true;
|
||||
enableNginx = true;
|
||||
nginx = {
|
||||
clientMaxBodySize = "50G";
|
||||
host = "binary-cache";
|
||||
};
|
||||
caches = {
|
||||
forkos.port = 8000;
|
||||
cno.port = 8001;
|
||||
forkos = {
|
||||
port = 8000;
|
||||
remote-path-info-service-addr = "nix+https://bagel-cache.s3-web.delroth.net";
|
||||
};
|
||||
cno = {
|
||||
port = 8001;
|
||||
remote-path-info-service-addr = "nix+https://cache.nixos.org?trusted-public-keys=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
|
||||
};
|
||||
third = {
|
||||
port = 8002;
|
||||
remote-path-info-service-addr = "nix+http://[::1]:8001/cno";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
clientMaxBodySize = "50G";
|
||||
virtualHosts.cache = {
|
||||
fileSystems."/var/lib/tvix-castore" = {
|
||||
device = "/nvme";
|
||||
options = [ "bind" ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.binary-cache = {
|
||||
enableACME = true;
|
||||
default = true;
|
||||
locations = {
|
||||
"/forkos".return = "302 /forkos/";
|
||||
"/forkos/".proxyPass = "http://localhost:${toString config.services.tvix-binary-cache.caches.forkos.port}/";
|
||||
"/cno".return = "302 /cno/";
|
||||
"/cno/".proxyPass = "http://localhost:${toString config.services.tvix-binary-cache.caches.cno.port}/";
|
||||
};
|
||||
};
|
||||
serverName = "tvix.store";
|
||||
serverAliases = [
|
||||
"cache.nixos.sh"
|
||||
];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
|
||||
environment.systemPackages = with pkgs; [ broot tree iotop glances htop ];
|
||||
}
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
"url": "https://git.dgnum.eu/mdebray/binary-cache.git"
|
||||
},
|
||||
"branch": "master",
|
||||
"revision": "7dac2d81b00a8652dc3554d872df96bbbf25e16c",
|
||||
"revision": "fa45ea47797c63bc259fbd6aa32b34f383878f14",
|
||||
"url": null,
|
||||
"hash": "sha256-oCooSHe4w70eKQIFdmoCai3QiR3EpjfUdt9BhkGWTpw="
|
||||
"hash": "sha256-66aRLAmelImRWFGav6N+sqieBQyMBrxEfGDOabKde3o="
|
||||
},
|
||||
"nixpkgs": {
|
||||
"type": "Channel",
|
||||
"name": "nixpkgs-unstable",
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre653845.9355fa86e6f2/nixexprs.tar.xz",
|
||||
"hash": "1gvnxs10qx98jb5xpv96v9q98l1jsaxpmxgqvdmzgaj0rss6lm4x"
|
||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre655005.cfa5366588c9/nixexprs.tar.xz",
|
||||
"hash": "08wwq26cd2g7h58bfavgvfmhwp2kh5v3qvf1a35xvd1rp20lzs3d"
|
||||
}
|
||||
},
|
||||
"version": 4
|
||||
|
|
Loading…
Reference in a new issue