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
nixos/stunnel: Make free-form #152065
nixos/stunnel: Make free-form #152065
Conversation
ea50d93
to
a5b3ca3
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraConfig never hurts... And adding tests is great, thanks!
a5b3ca3
to
2953cda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cheers!
I ran the new tests and confirmed it all works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
It's not possible to do this via a freeform module? Because I think that's preferred |
@mohe2015 - freeform module - Ah! Yes! That is definitely worth trying. Thanks! I'm flipping this PR to draft now & will be right back with that. |
28f8ee6
to
633416c
Compare
633416c
to
6943ae8
Compare
Per @mohe2015 's suggestion, this PR now converts stunnel into a free-form module, rather than merely adding text-based extraConfig escape hatches. This is now a more invasive change. I believe I've preserved backward compatibility: I added tests for the existing functionality in a separate commit before changing anything. Please have another look. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi! I've just been looking at converting something else to freeform and was pointed out at this: NixOS/rfcs#42
long story short, it looks like there's a generic way of creating freeform modules now instead of your generateConfig -- I'm not sure if that's important though as long as it works? clueless
that aside it looks good at first glance, I'd need to actually try a few old configs to convince myself it's mostly compatible but need to find some more time to do that..
EDIT: in particular for freeform things you could probably use pkgs.formats.ini or toml as is? it looks like a good match
6943ae8
to
04186ad
Compare
@martinetd - Unfortunately, the stunnel configuration format is kind of a mess. It is much less sophisticated than INI or TOML. For example, it doesn't have any notion of quoting and escaping. Given a section name with a I added a brief note to the configuration generator with this rationale. |
This unlocks stunnel's other ~100 configuration directives, allowing full stunnel use in NixOS.
@martinetd, @chkno -- Eh, actually it's not so bad. Now updated to use |
04186ad
to
0e857fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, didn't mean to make you do so much work - I was happy by a config is messed up the generator code wasn't that bad... But well ok thanks ;)
I've read through it (looks fine) and verified it doesn't break my simple setup. Thanks!
Thanks, martinetd! Any other reviewers have any feedback? |
I'd like to progress this toward merge. The PRs already reviewed thread says that it is for reviewers to submit things there, not PR authors, so can reviewers either link this PR there or give feedback here about what is needed before this PR can be merged? Thank you! |
Motivation for this change
Allow the use of stunnel functionality beyond the very small (5%) subset explicitly supported by the NixOS configuration schema.
Also, add some tests of core stunnel functionality.
This supersedes PR #96401, which proposed just adding a few more config directives rather than a general escape hatch.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-build . -A stunnel.tests
doesn't run the tests as the linked documentation suggests it should.nix-build . -A stunnel.tests.stunnel
does run the tests.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.sh
to update generated release notesFYI: stunnel maintainer @thoughtpolice, stunnel NixOS module author @lschuermann.