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 <masterancpp@gmail.com>
This commit is contained in:
parent
879292aa9e
commit
112f60afd1
|
@ -61,6 +61,8 @@
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
stateDirectory = "/gerrit-data/ows";
|
||||||
|
|
||||||
pushUrl = "ssh://ows_bot@cl.forkos.org:29418/nixpkgs";
|
pushUrl = "ssh://ows_bot@cl.forkos.org:29418/nixpkgs";
|
||||||
deployKeyPath = config.age.secrets.ows-deploy-key.path;
|
deployKeyPath = config.age.secrets.ows-deploy-key.path;
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,12 @@ in
|
||||||
description = "Working directory for the service";
|
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 {
|
pushUrl = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
example = "ssh://...";
|
example = "ssh://...";
|
||||||
|
@ -119,6 +125,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
fileSystems."/var/lib/onewaysync" = mkIf (cfg.stateDirectory != "/var/lib/onewaysync") {
|
||||||
|
device = cfg.stateDirectory;
|
||||||
|
options = [ "bind" ];
|
||||||
|
};
|
||||||
systemd.timers = mapAttrs' (name: value: {
|
systemd.timers = mapAttrs' (name: value: {
|
||||||
name = "ows-${name}";
|
name = "ows-${name}";
|
||||||
value = mkSyncTimer name value;
|
value = mkSyncTimer name value;
|
||||||
|
|
Loading…
Reference in a new issue