-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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/sslh: update and refactor for RFC42 #245855
Conversation
@symphorien This should superseed #225602 in fixing #225454. |
There are already existing efforts to have a libconfig format generator: #246115 |
Wow, that seems way overkill. In comparison, mine is a lot simpler purely Nix implementation of the conversion, it does not handle special ints and arrays, but they could be added in the same way, if needed. |
There's a Nix-only implementation in #208747 that was iterated on a few times before this comment which I am taking out of a bit of context:
After a long period of silence @h7x4 came in, reviving that PR with #246115 which also has output validation and a test alongside being written in a strongly-typed language. It should be a lot more robust. Sorry about the trouble though— I've also been rebasing my PRs until this thing wraps up. |
Well, I don't have any strong feelings about this as I'm just interested in fixing sslh. |
Rebased (since #246115 has been merged) and added a release note. |
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.
A few small comments. Some of the comments regard stuff that has just been moved, so feel free to ignore if you don't think it's relevant for the refactor.
}; | ||
|
||
options.verbose-connections = mkOption { | ||
type = types.enum [ 0 1 2 3 4 ]; |
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.
This is sort of a nit since both of these options work, but I feel like it's more semantically correct to look at this as a discrete range from least verbose to most verbose. Therefore, I think this would be more fitting
type = types.enum [ 0 1 2 3 4 ]; | |
type = types.ints.between 0 4; |
freeformType = configFormat.type; | ||
|
||
options.timeout = mkOption { | ||
type = types.int; |
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.
Assuming timeout of 0
is possible as well.
type = types.int; | |
type = types.ints.unsigned; |
}; | ||
|
||
listenAddresses = mkOption { | ||
type = types.coercedTo types.str singleton (types.listOf types.str); |
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.
nit, makes it a bit easier to read.
type = types.coercedTo types.str singleton (types.listOf types.str); | |
type = with types; coercedTo str singleton (listOf str); |
@h7x4 thank you, I applied you suggestions. |
Description of changes
Update the sslh package and rewrite the module for RFC42
Things done
sandbox = true
set innix.conf
? (See Nix manual)nixosTests.sslh
sslh
)./result/bin/
)