Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: toggle support for ConditionACPower option in borgmatic module #5890

Open
ZlobnuDima opened this issue Sep 24, 2024 · 5 comments
Open
Assignees

Comments

@ZlobnuDima
Copy link

Description

Is it possible to add support for toggle ConditionACPower option?

@rycee
Copy link
Member

rycee commented Sep 26, 2024

I can't say whether there should be a specific option for this in the module, @DamienCassou will have to say.

But I can mention that you should already be able to toggle it by adding

systemd.user.services.borgmatic.Unit.ConditionACPower = lib.mkForce false;

to your configuration.

@ZlobnuDima
Copy link
Author

ZlobnuDima commented Sep 26, 2024

@rycee, thanks. I'm checking your tips but it seems to be a bit off, or more accurately, it's working but not in the right way. It does back up, but only when the AC power is off. When I plug the laptop into AC power, I get errors:

...
Sep 26 15:12:46 nixos-hp systemd[1622]: borgmatic backup was skipped because of an unmet condition check (ConditionACPower=false).
...

When I asked for this option to be added, I wanted both battery and AC power to back up.
P.S. Is there the right way to exclude power state checking?

@rycee
Copy link
Member

rycee commented Sep 26, 2024

Ah, sorry I got confused. Yeah, then it probably needs to be a feature of the module.

Btw, could you see what

systemd.user.services.borgmatic.Unit.ConditionACPower = lib.mkForce "";

does?

@ZlobnuDima
Copy link
Author

ZlobnuDima commented Sep 26, 2024

@rycee, thanks. At first glance it works. Tomorrow I'll try to do it more carefully.

@ZlobnuDima
Copy link
Author

ZlobnuDima commented Sep 27, 2024

@rycee, In my opinion, this code solves my problem, but would you mind to add this workaround as an option where the user can decide what state the power should be in during the backup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants