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

irker: init at 2017-02-12 #23963

Merged
merged 2 commits into from Mar 17, 2017
Merged

irker: init at 2017-02-12 #23963

merged 2 commits into from Mar 17, 2017

Conversation

dtzWill
Copy link
Member

@dtzWill dtzWill commented Mar 16, 2017

  • irker package
  • NixOS module for irkerd service
Motivation for this change

IRC notification daemon for on-site installation with services like GitLab.

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

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


users.extraUsers = singleton {
name = "irkerd";
uid = config.ids.uids.irkerd;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why static uid?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I didn't realize you could assign them dynamically, I was looking at other services as examples. I'll look into dynamic, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

If uid is null it should assign a uid on system activation.

@joachifm
Copy link
Contributor

Please use separate commits.

@dtzWill
Copy link
Member Author

dtzWill commented Mar 16, 2017

Aye aye o7. I squashed them for submitting hehe, my mistake. Will fix with dynamic uid issue, thanks for the review!

@dtzWill
Copy link
Member Author

dtzWill commented Mar 16, 2017

Comments should be addressed now, thanks. Tested and seems to be working with dynamic user bit (after deactivating service to purge the user).

config = mkIf cfg.enable {
systemd.services.irkerd = {
description = "Internet Relay Chat (IRC) notification daemon";
requires = [ "network.target" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to do after instead, potentially you also might want to consider using network-online.target depending on what the desired semantics are.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had the same thought (at least regarding using after), but went with requires since that's what their provided systemd service file does. I'm not sure what the exact semantic differences are between the two, and since it seems after is the common situation I'd default to using that unless there's a good reason for the other? Anyway I'll update accordingly shortly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Pulling in network.target is likely always redundant for upper-layer service units. Specifying after is almost certainly correct, either way (dependency generally doesn't imply ordering).

@joachifm
Copy link
Contributor

I've pushed a few fixups. Also, wrt. to meta.platforms = unix I wonder if you'd need to at least make systemd conditional on stdenv.isLinux for that to work; otherwise perhaps just set platforms = linux.

@dtzWill
Copy link
Member Author

dtzWill commented Mar 17, 2017

Changes look great, thank you very much. Appreciate the explanations and effort, I'll keep them in mind in the future!

I also went ahead and actually removed the systemd dependency and related patching-- this was only used to help install the service file which we ignore anyway.

@joachifm joachifm merged commit 9a976c0 into NixOS:master Mar 17, 2017
@joachifm
Copy link
Contributor

LGTM. Thank you

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

4 participants