change atticd config

This commit is contained in:
Dmitriy Kholkin 2023-06-15 01:53:59 +03:00
parent 26278fa832
commit af914e1edc

View File

@ -5,28 +5,48 @@
services.atticd = { services.atticd = {
enable = true; enable = true;
credentialsFile = config.secrets.attic.decrypted; credentialsFile = config.secrets.attic.decrypted;
user = "atticd";
group = "atticd";
settings = { settings = {
# listen = "[::]:8080";
listen = "127.0.0.1:8083"; listen = "127.0.0.1:8083";
database.url = "postgresql:///atticd?host=/run/postgresql";
allowed-hosts = [ "cache.ataraxiadev.com" ]; allowed-hosts = [ "cache.ataraxiadev.com" ];
api-endpoint = "https://cache.ataraxiadev.com/"; api-endpoint = "https://cache.ataraxiadev.com/";
require-proof-of-possession = false; require-proof-of-possession = false;
garbage-collection = { garbage-collection = {
interval = "7 days"; interval = "3 days";
default-retention-period = "2 months"; default-retention-period = "1 month";
}; };
# Data chunking
chunking = { chunking = {
nar-size-threshold = 64 * 1024; # 64 KiB nar-size-threshold = 64 * 1024; # 64 KiB
# The preferred minimum size of a chunk, in bytes
min-size = 16 * 1024; # 16 KiB min-size = 16 * 1024; # 16 KiB
# The preferred average size of a chunk, in bytes
avg-size = 64 * 1024; # 64 KiB avg-size = 64 * 1024; # 64 KiB
# The preferred maximum size of a chunk, in bytes
max-size = 256 * 1024; # 256 KiB max-size = 256 * 1024; # 256 KiB
}; };
}; };
}; };
persist.state.directories = [ "/var/lib/private/atticd" ]; users.groups.atticd = {};
users.users.atticd = {
isSystemUser = true;
group = "atticd";
hashedPassword = "$y$j9T$ZC44T3XYOPapB26cyPsA4.$8wlYEbwXFszC9nrg0vafqBZFLMPabXdhnzlT3DhUit6";
};
systemd.services.atticd = {
serviceConfig.DynamicUser = lib.mkForce false;
};
services.postgresql = {
enable = true;
ensureUsers = [{
name = "atticd";
ensurePermissions = {
"DATABASE atticd" = "ALL PRIVILEGES";
};
}];
ensureDatabases = [ "atticd" ];
};
persist.state.directories = [ "/var/lib/atticd" ];
} }