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

arbtt service: init #21570

Merged
merged 1 commit into from Jan 11, 2017
Merged

arbtt service: init #21570

merged 1 commit into from Jan 11, 2017

Conversation

michaelpj
Copy link
Contributor

Motivation for this change

This adds a systemd user service for the arbtt time-tracking tool. Since arbtt is a passive tracker, you want it to be automatically running in the background at all times.

The one thing I couldn't work out how to do is to have the service only be enabled for some users. Currently if arbtt.enable = true, then the service runs for all users, which seems potentially undesirable.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@michaelpj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @bjornfor and @offlinehacker to be potential reviewers.

default = 60;
example = 120;
description = ''
The sampling frequency in seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frequency -> interval.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed.

@bjornfor
Copy link
Contributor

bjornfor commented Jan 1, 2017

The one thing I couldn't work out how to do is to have the service only be enabled for some users. Currently if arbtt.enable = true, then the service runs for all users, which seems potentially undesirable.

Maybe it is a program that doesn't make a lot of sense as a system-wide service?

Their installation instructions are:

cp /usr/share/doc/arbtt/examples/arbtt-capture.desktop ~/.config/autostart/

So it seems more like a per-user thing. Have you looked at systemd user services?

@bjornfor
Copy link
Contributor

bjornfor commented Jan 1, 2017

Doh, I see you have "systemd.user.services.arbtt" in there :-)

@michaelpj
Copy link
Contributor Author

Yeah, it's already a user service, but it's just that enabling it seems to enable it for all users. I guess there isn't really a sensible way this could work without some kind of user-specific nixos configuration, which doesn't seem to exist yet.

@joachifm
Copy link
Contributor

joachifm commented Jan 2, 2017

@michaelpj re per-user systemd user services, see also #21460

@michaelpj
Copy link
Contributor Author

Were there any other comments on this, or is it good to go?

@Mic92 Mic92 merged commit 62708c2 into NixOS:master Jan 11, 2017
@Mic92
Copy link
Member

Mic92 commented Jan 11, 2017

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

6 participants