kubernetes-deployments/images/attic.nix

64 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2024-10-28 15:05:06 +00:00
{
nixpkgs,
nglib,
...
}:
2024-10-01 16:46:15 +00:00
nglib.makeSystem {
inherit nixpkgs;
system = "x86_64-linux";
name = "nixng-attic";
2024-10-28 15:05:06 +00:00
config = {...}: {
2024-10-01 16:46:15 +00:00
dumb-init = {
enable = true;
2024-10-28 15:05:06 +00:00
type.services = {};
2024-10-01 16:46:15 +00:00
};
init.services.attic = {
shutdownOnExit = true;
};
services.attic = {
enable = true;
settings = {
# The '+" is to explicitly denote the end of the Vals expression.
# This is done because we quote the template for the toml file.
# See: https://github.com/helmfile/vals?tab=readme-ov-file#expression-syntax
# database.url = "ref+sops://secrets.yml#attic/databaseURL+";
2024-10-28 15:05:06 +00:00
database = {};
2024-10-01 16:46:15 +00:00
storage = {
type = "local";
path = "/var/lib/atticd/storage";
};
listen = "[::]:8080";
# Data chunking
#
# Warning: If you change any of the values here, it will be
# difficult to reuse existing chunks for newly-uploaded NARs
# since the cutpoints will be different. As a result, the
# deduplication ratio will suffer for a while after the change.
chunking = {
# The minimum NAR size to trigger chunking
#
# If 0, chunking is disabled entirely for newly-uploaded NARs.
# If 1, all NARs are chunked.
nar-size-threshold = 64 * 1024; # 64 KiB
# The preferred minimum size of a chunk, in bytes
min-size = 16 * 1024; # 16 KiB
# The preferred average size of a chunk, in bytes
avg-size = 64 * 1024; # 64 KiB
# The preferred maximum size of a chunk, in bytes
max-size = 256 * 1024; # 256 KiB
};
};
};
};
}