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

nsq: 0.3.5 -> 1.1.0, add nixos/nsq #57913

Closed
wants to merge 1 commit into from

Conversation

pjones
Copy link
Contributor

@pjones pjones commented Mar 19, 2019

Motivation for this change

Upgrade nsq to the latest release and create a NixOS module for it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@infinisil
Copy link
Member

Take a look at NixOS/rfcs#42. With the approach described there, the implementation of this will be simplified and also get correct merging behavior (recursiveUpdate doesn't merge correctly).

@@ -339,6 +339,7 @@
rss2email = 312;
cockroachdb = 313;
zoneminder = 314;
nsq = 315;
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can avoid allocating a user, by using the DynamicUser feature of systemd.

Copy link
Member

Choose a reason for hiding this comment

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

And if DynamicUser doesn't work, just a normal user without a static uid will work too

# Configuration for nsqd as a Nix attrset:
nsqdConfig = recursiveUpdate {
mem_queue_size = cfg.nsqd.queueSize;
data_path = "${cfg.dataDir}/nsqd";
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be /var/lib/nsqd.

wantedBy = [ "multi-user.target" ];
serviceConfig.User = cfg.user;
serviceConfig.Group = cfg.group;
serviceConfig.PermissionsStartOnly = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

we can drop this, and let systemd handle creation of the state directory.

@pjones
Copy link
Contributor Author

pjones commented Apr 18, 2019

Turns out that I'm not going to need NSQ in NixOS right now. I'll revisit this in the future.

@pjones pjones closed this Apr 18, 2019
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