1
0
Fork 0
forked from DGNum/snix-cache
No description
Find a file
2025-04-15 12:02:09 +02:00
LICENSES feat(reuse): Introduce nix-reuse and add information 2025-04-02 17:53:50 +02:00
nix feat(module): Misc rewrites 2025-04-15 12:02:09 +02:00
npins feat(reuse): Introduce nix-reuse and add information 2025-04-02 17:53:50 +02:00
src fix(tracing): Keep some tracing 2025-04-04 20:04:14 +02:00
tests chore(tests): Reformat 2025-04-15 11:59:11 +02:00
.envrc chore: Setup direnv 2025-01-14 09:36:23 +01:00
.gitignore chore: Setup direnv 2025-01-14 09:36:23 +01:00
Cargo.lock feat(composition): Allow substituting CREDENTIALS_DIRECTORY in the config 2025-03-21 15:25:25 +01:00
Cargo.toml feat(composition): Allow substituting CREDENTIALS_DIRECTORY in the config 2025-03-21 15:25:25 +01:00
default.nix feat(reuse): Introduce nix-reuse and add information 2025-04-02 17:53:50 +02:00
README.md feat(reuse): Introduce nix-reuse and add information 2025-04-02 17:53:50 +02:00
REUSE.toml feat(reuse): Introduce nix-reuse and add information 2025-04-02 17:53:50 +02:00
rustfmt.toml feat: init 2024-07-24 10:24:52 +02:00
shell.nix feat(nix): Small tweaks 2025-03-21 15:25:55 +01:00

snix-cache

This is some wiring code to spawn as much narbridges you want and snix backend services composed using the store composition feature.

See e200ae53a4/machines/storage01/tvix-cache/default.nix for a usage exemple

Example config

{
  config,
  pkgs,
  sources,
  ...
}:

let
  host = "snix-cache.example.com";
in

{
  imports = [ "${sources.snix-cache}/nix/module.nix" ];

  nixpkgs.overlays = [ (import sources.snix-cache { inherit pkgs; }).overlay ];

  services.snix-cache = {
    enable = true;

    inherit host;

    caches = {
      default = {
        maxBodySize = "50G";

        uploadPasswordFile = config.age.secrets."nginx-snix_cache_default".path;
        signingPasswordFile = config.age.secrets."nginx-snix_cache_default.signing".path;

        signingKeyFile = config.age.secrets."snix-cache-default_signing_key".path;
        publicKey = "default.snix-cache.example.com-1:numjqGylTs8nVaEl/jQ1Hp0tA0tmosMGq3awZVkCcWM=";
      };
    };
  };

  services.nginx.virtualHosts.${host} = {
    enableACME = true;
    forceSSL = true;
  };
}