From d3c6f9b1d13a723e347bc998dd5650a4c55a3941 Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Wed, 28 Oct 2026 14:58:10 +0100 Subject: [PATCH] feat: setup attic --- flake.lock | 8 ++++---- hosts/ws-home/configuration.nix | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index c86f26a..39535e2 100644 --- a/flake.lock +++ b/flake.lock @@ -176,11 +176,11 @@ }, "secrets": { "locked": { - "lastModified": 1766822527, - "narHash": "sha256-0qNxAxr7LQ8C6MjSxV2FkMSfdVmOVRq7Yz/wCea8plo=", + "lastModified": 1793195490, + "narHash": "sha256-1ReF2oGuTGF1osuK3Pc0N4C5QKQfoSbv/2HO3OJCkqw=", "ref": "refs/heads/main", - "rev": "695e36891b5de248993845e1435df5e4116a26f2", - "revCount": 21, + "rev": "02313098cbcf69356df75ba0895c913b053a2edf", + "revCount": 22, "type": "git", "url": "ssh://gitea@git.bulthuis.dev/Jan/nixos-secrets" }, diff --git a/hosts/ws-home/configuration.nix b/hosts/ws-home/configuration.nix index 7215a53..c08a030 100644 --- a/hosts/ws-home/configuration.nix +++ b/hosts/ws-home/configuration.nix @@ -1,4 +1,6 @@ { + config, + inputs, ... }: @@ -32,6 +34,7 @@ }; modules.impermanence.directories = [ "/var/lib/private/matterjs-server" + "/var/lib/private/atticd" { directory = "/var/lib/hass"; user = "hass"; @@ -41,6 +44,7 @@ ]; systemd.tmpfiles.rules = [ "d /var/lib/private 0700 root root -" + "d /persist/system/var/lib/private 0700 root root -" ]; networking.firewall.allowedUDPPorts = [ 5353 # mDNS @@ -68,8 +72,26 @@ }; networking.firewall.allowedTCPPorts = [ 8123 # Home Assistant + 8080 # Attic ]; + # Attic binary cache, served as cache.ib.baksteeninc.net behind the reverse proxy + sops.secrets."atticd/env".sopsFile = "${inputs.secrets}/secrets/ws-home.enc.yaml"; + services.atticd = { + enable = true; + environmentFile = config.sops.secrets."atticd/env".path; + settings = { + listen = "[::]:8080"; + api-endpoint = "https://cache.ib.baksteeninc.net/"; + compression.type = "zstd"; + garbage-collection = { + interval = "12 hours"; + # Drop paths that have not been accessed for this long + default-retention-period = "3 months"; + }; + }; + }; + # Set up hardware imports = [ ./hardware-configuration.nix ]; }