Conversation
98f7072 to
91ac193
Compare
maintainers/maintainer-list.nix
Outdated
There was a problem hiding this comment.
This must be done in a separate commit, as per CONTRIBUTING.md
When adding yourself as maintainer, in the same pull request, make a separate commit with the message
maintainers: add <handle>. Add the commit before those making changes to the package or module
There was a problem hiding this comment.
Thank you! I fixed the PR.
9e092b1 to
f8f6bf6
Compare
1036578 to
b4d86cf
Compare
b4d86cf to
64202c2
Compare
1404a76 to
7acfc15
Compare
|
I rebased this PR. It's ready again to be merged, if someone can approve. Thanks. |
There was a problem hiding this comment.
Wow this is an old PR, I'm surprised it's gotten so little attention. Few minor things, otherwise it looks good. I wasn't able to actually test the module since I don't have a key (and don't want to apply for one), but the documented options & config format match upstream's.
New modules should also be added to the release notes.
| mkKeyValue = k: v: if v == null then "" else lib.generators.mkKeyValueDefault { } "=" k v; | ||
| }; | ||
| in | ||
| with lib; |
There was a problem hiding this comment.
Done.
Thanks for the review!
| let | ||
| stateDirectory = "fishnet"; | ||
| in |
There was a problem hiding this comment.
I feel like this should be customizable, including the /var/lib prefix
There was a problem hiding this comment.
It's necessary in /var/lib if we want to leverage systemd managing the directory: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=
I know some modules handle paths in or out of /var/lib/ differently, but this seems overkill here.
I can make the base name customizable though.
What do you think?
There was a problem hiding this comment.
You're right, grepping through the repo most of the modules seem to also hardcode their state dirs. Some do have options for changing it, but it's probably not necessary here.
I'd still probably hardcode it directly instead of using the let though, since it's pretty much guaranteed not to change and most other modules also just set it directly.
There was a problem hiding this comment.
I kept the variable to not repeat myself.
| type = types.submodule { | ||
| freeformType = format.type; | ||
|
|
||
| options.Fishnet = { |
There was a problem hiding this comment.
Running fishnet configure seems to output all-lowercase options, if the config is case insensitive I'd probably document everything either in all lowercase (to match upstream) or in camelCase (to match most other NixOS options).
There was a problem hiding this comment.
Done with all in lowercase.
7acfc15 to
975d693
Compare
975d693 to
e55f2ae
Compare
e55f2ae to
9fbbea4
Compare
maevii
left a comment
There was a problem hiding this comment.
Few more things I missed the first time around, sorry. Other than that everything LGTM.
| }; | ||
|
|
||
| assertions = lib.singleton { | ||
| assertion = (cfg.settings.fishnet.key == null) != (cfg.keyfile == null); |
There was a problem hiding this comment.
What about the case where neither are set? Assertions/warnings should also be defined at the top of config rather than the bottom.
| assertion = (cfg.settings.fishnet.key == null) != (cfg.keyfile == null); | |
| assertion = cfg.settings.fishnet.key != null || cfg.keyfile != null; |
There was a problem hiding this comment.
I moved the assertion.
I believe it was correct though, I test that exactly one of key or keyfile is not null. My version is an exclusive or (!= for booleans is XOR) while yours is a regular or which would allow both options to be set.
There was a problem hiding this comment.
You're absolutely right, sorry! Somehow I forgot for a second that assertions work the opposite from warnings (true != true -> false, which is correct here but wouldn't be in a warning), then remembered that when I was making the suggestion, but also forgot both options can't be set at the same time.
Sorry again, thanks for calling me out. Think I need more sleep...
|
|
||
| format = pkgs.formats.ini { | ||
| # Skip null values. | ||
| mkKeyValue = k: v: if v == null then "" else lib.generators.mkKeyValueDefault { } "=" k v; |
There was a problem hiding this comment.
| mkKeyValue = k: v: if v == null then "" else lib.generators.mkKeyValueDefault { } "=" k v; | |
| mkKeyValue = k: v: lib.optionalString (v != null) (lib.generators.mkKeyValueDefault { } "=" k v); |
Very much a nitpick, but since you use optionalString in ExecStart I think this would be better for consistency
9fbbea4 to
280d143
Compare
maevii
left a comment
There was a problem hiding this comment.
Alright, everything looks good to me now.
Requesting @SuperSandro2000 for review/merge, since this PR is almost 3 years old and would probably slip under the radar otherwise.
Description of changes
Adds a module to run fishnet, a distributed Stockfish analysis for lichess.org.
Fixes #110678.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes