From c20fc52f97587335af88e13630104890faa494bb Mon Sep 17 00:00:00 2001 From: ahuston-0 Date: Sat, 29 Mar 2025 16:36:10 -0400 Subject: [PATCH] re-enable attic sync --- systems/palatine-hill/attic/default.nix | 102 ++++++++++---------- systems/palatine-hill/attic/sync-attic.bash | 2 +- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/systems/palatine-hill/attic/default.nix b/systems/palatine-hill/attic/default.nix index 1fc9e29..28c1b47 100644 --- a/systems/palatine-hill/attic/default.nix +++ b/systems/palatine-hill/attic/default.nix @@ -62,58 +62,58 @@ # borrowing from https://github.com/Shawn8901/nix-configuration/blob/4b8d1d44f47aec60feb58ca7b7ab5ed000506e90/modules/nixos/private/hydra.nix # configured default webstore for this on root user separately - # systemd = { - # services = { - # attic-watch-store = { - # wantedBy = [ "multi-user.target" ]; - # after = [ - # "network-online.target" - # "docker.service" - # "atticd.service" - # ]; - # requires = [ - # "network-online.target" - # "docker.service" - # "atticd.service" - # ]; - # description = "Upload all store content to binary cache"; - # serviceConfig = { - # User = "root"; - # Restart = "always"; - # ExecStart = "${pkgs.attic-client}/bin/attic watch-store cache-nix-dot"; - # }; - # }; - # attic-sync-hydra = { - # after = [ - # "network-online.target" - # "docker.service" - # "atticd.service" - # ]; - # requires = [ - # "network-online.target" - # "docker.service" - # "atticd.service" - # ]; - # description = "Force resync of hydra derivations with attic"; - # serviceConfig = { - # Type = "oneshot"; - # User = "root"; - # ExecStart = "${config.nix.package}/bin/nix ${./sync-attic.bash}"; - # }; - # }; - # }; + systemd = { + services = { + attic-watch-store = { + wantedBy = [ "multi-user.target" ]; + after = [ + "network-online.target" + "docker.service" + "atticd.service" + ]; + requires = [ + "network-online.target" + "docker.service" + "atticd.service" + ]; + description = "Upload all store content to binary cache"; + serviceConfig = { + User = "root"; + Restart = "always"; + ExecStart = "${pkgs.attic-client}/bin/attic watch-store cache-nix-dot"; + }; + }; + attic-sync-hydra = { + after = [ + "network-online.target" + "docker.service" + "atticd.service" + ]; + requires = [ + "network-online.target" + "docker.service" + "atticd.service" + ]; + description = "Force resync of hydra derivations with attic"; + serviceConfig = { + Type = "oneshot"; + User = "root"; + ExecStart = "${config.nix.package}/bin/nix ${./sync-attic.bash}"; + }; + }; + }; - # timers = { - # attic-sync-hydra = { - # wantedBy = [ "timers.target" ]; - # timerConfig = { - # OnBootSec = 600; - # OnUnitActiveSec = 86400; - # Unit = "attic-sync-hydra.service"; - # }; - # }; - # }; - # }; + timers = { + attic-sync-hydra = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnBootSec = 600; + OnUnitActiveSec = 86400; + Unit = "attic-sync-hydra.service"; + }; + }; + }; + }; sops = { secrets = { diff --git a/systems/palatine-hill/attic/sync-attic.bash b/systems/palatine-hill/attic/sync-attic.bash index 57ecdd0..eaa1128 100644 --- a/systems/palatine-hill/attic/sync-attic.bash +++ b/systems/palatine-hill/attic/sync-attic.bash @@ -6,5 +6,5 @@ sync_directories=( ) for dir in "${sync_directories[@]}"; do - find "$dir" -regex ".*\.drv$" -exec attic push cache-nix-dot '{}' \; + find "$dir" -regex ".*\.drv$" -exec attic push nix-cache '{}' \; done