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
ssh: put custom options before generated options #53767
Conversation
nixos/tests/openssh.nix
Outdated
|
||
subtest "configuration", sub { | ||
$client->succeed("ssh -G other_server | grep -i 'addressfamily any'"); | ||
$client->succeed("ssh -G example_server | grep -i 'addressfamily inet'"); |
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.
Not sure if we need an extra test for that.
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.
Fair enough, will drop that commit.
@@ -203,6 +203,9 @@ in | |||
# generation in the sshd service. | |||
environment.etc."ssh/ssh_config".text = | |||
'' | |||
${cfg.extraConfig} |
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.
${cfg.extraConfig} | |
# To allow users to override existing configuration, we prepend `extraConfig`. | |
${cfg.extraConfig} |
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.
Is this comment aimed at people inspecting /etc/ssh/ssh_config
, or people reading ssh.nix
?
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.
Ah right. Your version makes more sense.
@Mic92 I think I have addressed your comments |
@GrahamcOfBorg build nixosTests.openssh |
@Mic92 - any update on this? |
@@ -203,6 +203,9 @@ in | |||
# generation in the sshd service. | |||
environment.etc."ssh/ssh_config".text = | |||
'' | |||
${cfg.extraConfig} | |||
|
|||
Host * |
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.
What's this for?
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.
The Host *
is so the following config options apply to all hosts if they haven't been set before. For example if cfg.extraConfig
is:
Host example.com
Port 10022
then the options below would only apply to example.com
without the Host *
- ssh options are not indentation sensitive, that is just for readability.
Can you squash the commits together? And then the commit message should have the "nixos/ssh:" prefix instead. |
Otherwise, the standard options (e.g. AddressFamily) cannot be overriden in extraConfig, as the option is applied on the first (not most specific) match. Closes NixOS#52267
@infinisil rebased onto master and squashed commits |
Otherwise, the standard options (e.g. AddressFamily) cannot be overriden
in extraConfig, as the option is applied on the first (not most
specific) match. Closes #52267
Motivation for this change
See bug #52267
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)