Skip to content

nixos/crowdsec: init module - #437310

Merged
MattSturgeon merged 2 commits into
NixOS:masterfrom
TornaxO7:init-crowdsec
Sep 5, 2025
Merged

MattSturgeon merged 2 commits into
NixOS:masterfrom
TornaxO7:init-crowdsec

Conversation

@TornaxO7

Copy link
Copy Markdown
Contributor

Continues #426875 due to a probably stupid mistake from my side...
I hope that I correctly applied the Co-authored-by in the last commit. If not: Feel free to correct me.

I'm sorry for the noise.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@TornaxO7

TornaxO7 commented Aug 26, 2025 •

Copy link
Copy Markdown
Contributor Author

@rharish101 you can try this branch out again. I've added the services.crowdsec.hub.branch option.
I've also added the DynamicUser = true option.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Aug 26, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Aug 26, 2025
@TornaxO7 TornaxO7 mentioned this pull request Aug 27, 2025
13 tasks
@rharish101

Copy link
Copy Markdown
Contributor

Seems to be working fine so far with DynamicUser. I haven't tried to override the services.crowdsec.hub.branch, but it didn't crash (meaning that the default of master works).

I did see a few minor issues, so I'll try to point them out as a review.

@rharish101 rharish101 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor nits, but without them, my config doesn't build.

rharish101 added a commit to rharish101/nix-configs that referenced this pull request Aug 27, 2025
@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Aug 27, 2025
@TornaxO7

Copy link
Copy Markdown
Contributor Author

Minor nits, but without them, my config doesn't build.

I applied your suggestions.

@ofborg ofborg Bot added the ofborg-internal-error Ofborg encountered an error label Aug 27, 2025

@MattSturgeon MattSturgeon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've not reviewed in depth and I'm not too familiar with crowdsec or similar existing modules in NixOS. But here's some thoughts:

Comment thread maintainers/maintainer-list.nix Resolved
Comment thread maintainers/maintainer-list.nix Resolved
Comment thread maintainers/maintainer-list.nix Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect it may be simpler (and more robust) to use mkMerge in this systemd.tmpfiles.settings definition, instead of using // updates.

One case mkMerge handles better is when the same attrname is defined by both sides. // would simply shadow the LHS with the RHS's value, while mkMerge would merge the two definitions (or throw a sane error if that's not possible).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see your point but I think that I'm not experienced enough to give a strong opinion about this... but I'd say that using mkMerge may be the more intuitive one.
However, I'd wait for another opinion who is more experienced than me 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I question why we need a parsePortFromURLOption function at all, when it is only used once.

Would it make more sense to use let bindings to make the "extract a port" logic more readable? Or even lib.pipe it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with both ways.

@ofborg ofborg Bot removed the ofborg-internal-error Ofborg encountered an error label Aug 27, 2025
Co-Authored-By: acuteaangle <[email protected]>
Co-Authored-By: m0ustach3 <[email protected]>
@TornaxO7

Copy link
Copy Markdown
Contributor Author

@MattSturgeon thank you for your review! I applied the easier changes. If you want, you can skim through it again.

@TornaxO7

TornaxO7 commented Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

@rharish101 may I ask if everything worked on your system? Did you encounter any issues?

@rharish101

Copy link
Copy Markdown
Contributor

@rharish101 may I ask if everything worked on your system? Did you encounter any issues?

No issues, everything's working perfectly! I'd be happy if this got merged as soon as we can.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 2, 2025
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/5833

@MattSturgeon
MattSturgeon merged commit 0934f3b into NixOS:master Sep 5, 2025
@MattSturgeon

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

@TornaxO7

TornaxO7 commented Sep 5, 2025

Copy link
Copy Markdown
Contributor Author

@rharish101

Copy link
Copy Markdown
Contributor

Thanks a lot everyone!

M0ustach3 added a commit to M0ustach3/nixpkgs that referenced this pull request Sep 5, 2025
@rharish101 rharish101 mentioned this pull request Sep 9, 2025
3 of 13 tasks
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Sep 10, 2025
@ThinkChaos

Copy link
Copy Markdown
Contributor

Thank you for this!
I'll be using it very soon and I'm glad I won't have to make my own service :)

samueldr-at-cyberus added a commit to samueldr-at-cyberus/nixpkgs that referenced this pull request Jan 27, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, NixOS#426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - NixOS#426687 (comment)

Then, in NixOS#437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.
samueldr-at-cyberus added a commit to samueldr-at-cyberus/nixpkgs that referenced this pull request Jan 27, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, NixOS#426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - NixOS#426687 (comment)

Then, in NixOS#437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.
samueldr-at-cyberus added a commit to samueldr-at-cyberus/nixpkgs that referenced this pull request Jan 27, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, NixOS#426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - NixOS#426687 (comment)

Then, in NixOS#437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.
philiptaron pushed a commit to philiptaron/nixpkgs that referenced this pull request Jan 27, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, NixOS#426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - NixOS#426687 (comment)

Then, in NixOS#437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.

(cherry picked from commit 43eca5c)
philiptaron pushed a commit that referenced this pull request Jan 27, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, #426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - #426687 (comment)

Then, in #437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.

(cherry picked from commit 43eca5c)
Gigahawk pushed a commit to Gigahawk/nixpkgs that referenced this pull request Jan 30, 2026
Two different PRs, two different issues.

The first PR, chronologically-merged-in, NixOS#426687 introduced a new
module, and while reviewers “reviewed” the `meta.maintainers` entry,
they did not notice the maintainer was not in the maintainers list file.

 - NixOS#426687 (comment)

Then, in NixOS#437310, merged a few days later, another new module was added
with M0ustach3 as a maintainer. At the very least, an attempt was made
in de66c73 to add the maintainer to the
list, but an unfortunate typo (or two?) in the maintainers list entry
means the two intended usage of the new entry still don't work.

The issue here is not from the contributors. The reviewers and
committers could have done better, but it's not even truly their fault.
The issue is the meta information in NixOS modules was never checked. In
any way AFAICT. Otherwise this would have been caught immediately, and
not four months later.

Anyway, the intent clearly is that the entry should matche the GitHub
username.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants