feat: Add atticd service to sgx-nixos system

This commit includes the atticd service to the sgx-nixos system. The `atticd.nix` file has been added with default configuration and the attic service has been included in imports in `default.nix`. Modifications were made in `flake.nix` and `flake.lock` to integrate attic dependencies.
This commit is contained in:
Harald Hoyer 2024-06-28 11:01:44 +02:00
parent 2629021f33
commit 3c58dfb400
4 changed files with 171 additions and 35 deletions

View file

@ -0,0 +1,36 @@
{ pkgs, lib, config, ... }:
{
services.atticd = {
enable = true;
# Replace with absolute path to your credentials file
credentialsFile = "/etc/atticd.env";
settings = {
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
};
};
};
}

View file

@ -2,7 +2,10 @@
with lib;
with lib.metacfg;
{
imports = [ ./hardware-configuration.nix ];
imports = [
./hardware-configuration.nix
./atticd.nix
];
boot.kernel.sysctl."net.ipv4.conf.all.route_localnet" = 1;
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;