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.
|
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;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
networking.hostName = "tvix-binary-cache"; # Define your hostname.
|
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.
|
# Set your time zone.
|
||||||
time.timeZone = "Europe/Paris";
|
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 = {
|
services.tvix-binary-cache = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableNginx = true;
|
||||||
|
nginx = {
|
||||||
|
clientMaxBodySize = "50G";
|
||||||
|
host = "binary-cache";
|
||||||
|
};
|
||||||
caches = {
|
caches = {
|
||||||
forkos.port = 8000;
|
forkos = {
|
||||||
cno.port = 8001;
|
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 = {
|
fileSystems."/var/lib/tvix-castore" = {
|
||||||
enable = true;
|
device = "/nvme";
|
||||||
recommendedProxySettings = true;
|
options = [ "bind" ];
|
||||||
clientMaxBodySize = "50G";
|
};
|
||||||
virtualHosts.cache = {
|
|
||||||
|
services.nginx.virtualHosts.binary-cache = {
|
||||||
|
enableACME = true;
|
||||||
default = true;
|
default = true;
|
||||||
locations = {
|
serverName = "tvix.store";
|
||||||
"/forkos".return = "302 /forkos/";
|
serverAliases = [
|
||||||
"/forkos/".proxyPass = "http://localhost:${toString config.services.tvix-binary-cache.caches.forkos.port}/";
|
"cache.nixos.sh"
|
||||||
"/cno".return = "302 /cno/";
|
];
|
||||||
"/cno/".proxyPass = "http://localhost:${toString config.services.tvix-binary-cache.caches.cno.port}/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
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"
|
"url": "https://git.dgnum.eu/mdebray/binary-cache.git"
|
||||||
},
|
},
|
||||||
"branch": "master",
|
"branch": "master",
|
||||||
"revision": "7dac2d81b00a8652dc3554d872df96bbbf25e16c",
|
"revision": "fa45ea47797c63bc259fbd6aa32b34f383878f14",
|
||||||
"url": null,
|
"url": null,
|
||||||
"hash": "sha256-oCooSHe4w70eKQIFdmoCai3QiR3EpjfUdt9BhkGWTpw="
|
"hash": "sha256-66aRLAmelImRWFGav6N+sqieBQyMBrxEfGDOabKde3o="
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"type": "Channel",
|
"type": "Channel",
|
||||||
"name": "nixpkgs-unstable",
|
"name": "nixpkgs-unstable",
|
||||||
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre653845.9355fa86e6f2/nixexprs.tar.xz",
|
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre655005.cfa5366588c9/nixexprs.tar.xz",
|
||||||
"hash": "1gvnxs10qx98jb5xpv96v9q98l1jsaxpmxgqvdmzgaj0rss6lm4x"
|
"hash": "08wwq26cd2g7h58bfavgvfmhwp2kh5v3qvf1a35xvd1rp20lzs3d"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": 4
|
"version": 4
|
||||||
|
|
Loading…
Reference in a new issue