refactor(ops/machines/snix-cache): use new snix.store domain

Provide redirects when the old domain is accessed, which Nix seems to
follow.

We keep the same hostname, so historical node exporter graphs are still
visible.

Change-Id: Icecd7f5324ac25bbfd4c003ca9cc65681114f0b5
Reviewed-on: https://cl.snix.dev/c/snix/+/30484
Reviewed-by: edef <edef@edef.eu>
Tested-by: besadii
Autosubmit: Florian Klink <flokli@flokli.de>
This commit is contained in:
Florian Klink 2025-05-07 11:55:41 +03:00 committed by clbot
parent 7eb15f8123
commit 5dbe46eea7
4 changed files with 11 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# nixos-tvix-cache # nixos-snix-cache
This is a fetch-through mirror of cache.nixos.org, hosted by NumTide. This is a fetch-through mirror of cache.nixos.org, hosted by NumTide.
@ -8,7 +8,7 @@ and 2x1TB NVMe disks.
The goals of this machine: The goals of this machine:
- Exercise snix-store and nar-bridge code - Exercise snix-store and nar-bridge code
- Collect usage metrics (see [Grafana](https://nixos.tvix.store/grafana)) - Collect usage metrics (see [Grafana](https://nixos.snix.store/grafana))
- Identify bottlenecks in the current implementations and fix them - Identify bottlenecks in the current implementations and fix them
- Replace cache.nixos.org? - Replace cache.nixos.org?
@ -16,7 +16,7 @@ You can configure this as a Nix substitutor on your systems like this:
```nix ```nix
nix.settings.substituters = [ nix.settings.substituters = [
"https://nixos.tvix.store" "https://nixos.snix.store"
]; ];
``` ```

View file

@ -28,7 +28,7 @@ in
options = { options = {
machine.domain = lib.mkOption { machine.domain = lib.mkOption {
type = lib.types.str; type = lib.types.str;
default = "nixos.tvix.store"; default = "nixos.snix.store";
}; };
}; };

View file

@ -3,7 +3,7 @@
imports = [ ./nar-bridge-module.nix ]; imports = [ ./nar-bridge-module.nix ];
# Microbenchmark # Microbenchmark
# hyperfine --warmup 1 'rm -rf /tmp/cache; nix copy --from https://nixos.tvix.store/ --to "file:///tmp/cache?compression=none" /nix/store/jlkypcf54nrh4n6r0l62ryx93z752hb2-firefox-132.0' # hyperfine --warmup 1 'rm -rf /tmp/cache; nix copy --from https://nixos.snix.store/ --to "file:///tmp/cache?compression=none" /nix/store/jlkypcf54nrh4n6r0l62ryx93z752hb2-firefox-132.0'
services.nginx = { services.nginx = {
package = pkgs.nginxStable; package = pkgs.nginxStable;
virtualHosts.${config.machine.domain} = { virtualHosts.${config.machine.domain} = {
@ -47,6 +47,11 @@
rewrite ^/nar/tvix-castore/(.*)$ /nar/snix-castore/$1 redirect; rewrite ^/nar/tvix-castore/(.*)$ /nar/snix-castore/$1 redirect;
''; '';
}; };
virtualHosts."nixos.tvix.store" = {
forceSSL = true;
enableACME = true;
locations."/".return = "301 https://nixos.snix.store$request_uri";
};
# use more cores for compression # use more cores for compression
appendConfig = '' appendConfig = ''

View file

@ -44,7 +44,7 @@ in rec {
public01System = nixosFor depot.ops.machines.public01; public01System = nixosFor depot.ops.machines.public01;
build01System = nixosFor depot.ops.machines.build01; build01System = nixosFor depot.ops.machines.build01;
meta01System = nixosFor depot.ops.machines.meta01; meta01System = nixosFor depot.ops.machines.meta01;
nixosSnixCache = nixosFor depot.ops.machines.snix-cache; nixosSnixCacheSystem = nixosFor depot.ops.machines.snix-cache;
meta.ci.targets = [ meta.ci.targets = [
"archivistEC2System" "archivistEC2System"