From 112f60afd1c6b1661f5e5eaa63ddc1eb53cb72bd Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 11 Dec 2024 18:42:57 +0100 Subject: [PATCH] feat(ows): support moving away onewaysync We are running into too many out of disk space situations with OWS on the main disk. This way, we can reuse the Gerrit disk for all that data, which hopefully, is quite shared with Gerrit. Signed-off-by: Raito Bezarius --- hosts/gerrit01/default.nix | 2 ++ services/gerrit/one-way-sync.nix | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/hosts/gerrit01/default.nix b/hosts/gerrit01/default.nix index 085dce7..6f25c9c 100755 --- a/hosts/gerrit01/default.nix +++ b/hosts/gerrit01/default.nix @@ -61,6 +61,8 @@ { enable = true; + stateDirectory = "/gerrit-data/ows"; + pushUrl = "ssh://ows_bot@cl.forkos.org:29418/nixpkgs"; deployKeyPath = config.age.secrets.ows-deploy-key.path; diff --git a/services/gerrit/one-way-sync.nix b/services/gerrit/one-way-sync.nix index 39570b0..b0a5ef8 100644 --- a/services/gerrit/one-way-sync.nix +++ b/services/gerrit/one-way-sync.nix @@ -71,6 +71,12 @@ in description = "Working directory for the service"; }; + stateDirectory = mkOption { + type = types.str; + default = "/var/lib/onewaysync"; + description = "State directory where the copies of nixpkgs are stored"; + }; + pushUrl = mkOption { type = types.str; example = "ssh://..."; @@ -119,6 +125,10 @@ in }; config = mkIf cfg.enable { + fileSystems."/var/lib/onewaysync" = mkIf (cfg.stateDirectory != "/var/lib/onewaysync") { + device = cfg.stateDirectory; + options = [ "bind" ]; + }; systemd.timers = mapAttrs' (name: value: { name = "ows-${name}"; value = mkSyncTimer name value;