-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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-copy-id: init at 8.4p1 #105896
ssh-copy-id: init at 8.4p1 #105896
Conversation
Please target staging with the mass rebuild. Also I am not sure if this is worth the benefit. The openssh package is ~6.23 MB and over 1000 other packages want to download it anyway. |
The main problem with bundling ssh and ssh-copy-id into a single package is that it would overshadow the preinstalled ssh. This is undesirable on macOS because the preinstalled version is tweaked to integrate with the system keychain. Replacing that with openssh upstream would break existing workflows for many users. |
I've just successfully ran nixos/tests/openssh.nix. |
Package closure size From 20.09: ❯ nix path-info -S "$(which ssh)"
/nix/store/jln5qqzyy4laawfp5y4f4lqgiwja9n1l-openssh-8.3p1 171975736 This PR: ❯ nix path-info -S "$(nix-build --no-out-link -A openssh.out)"
/nix/store/lw81h47vxsinc1ayxvpbc1a2vqcgv59j-openssh-8.4p1 111366840
❯ nix path-info -S "$(nix-build --no-out-link -A openssh.man)"
/nix/store/afvy3yac5jr616jvapa8f1h32zp9nnjj-openssh-8.4p1-man 90808
❯ nix path-info -S "$(nix-build --no-out-link -A openssh.ssh_copy_id)"
/nix/store/w1wxr8kjfgm40m7dxnjwh1xidf4ybvvr-openssh-8.4p1-ssh_copy_id 34288168 |
But why do you need copy-id then? Can't you just use the system one or add an alias for copy-id to the nix copy id one? |
macOS doesn't come preinstalled with ssh-copy-id so people install it through package managers. For what it's worth, it ranks 271 on the list of popular packages in Homebrew so it's a somewhat popular package on macOS 1. On the other hand, for the alias approach to work, the nix profile path would have to come after |
mkdir -p $ssh_copy_id/bin $man/share/man/man1 | ||
cp contrib/ssh-copy-id $ssh_copy_id/bin/ | ||
chmod +x $ssh_copy_id/bin/ssh-copy-id | ||
cp contrib/ssh-copy-id.1 $man/share/man/man1/ |
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.
To avoid breaking things, can you install a symlink in $out as well? This is so that things like lib.getBin openssh
have all of the outputs. This still allows for users to install ssh_copy_id output.
Something like:
$ ln -s $ssh_copy_id/bin/ssh-copy-id $out/bin/ssh-copy-id
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.
Fixed.
pkgs/top-level/all-packages.nix
Outdated
@@ -6251,6 +6251,8 @@ in | |||
pam = if stdenv.isLinux then pam else null; | |||
}; | |||
|
|||
ssh-copy-id = openssh.ssh_copy_id; |
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.
Note, that how nix-env works will ignore which output selected since. I think nix profile install
may not have this same issue.
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.
Oh my, I wasn't aware of this. Running nix-env -f . -A ssh-copy-id
does indeed link the whole ssh package into my user profile.
I think I'll change this PR to split out the ssh-copy-id package instead of using multiple outputs, since nix-env would likely be here to stay for years to come.
56de369
to
3c871ce
Compare
3c871ce
to
9d726b1
Compare
I've split |
@midchildan Can you please resolve the merge conflict? |
9d726b1
to
33fb990
Compare
I've changed this PR to use |
4ca56f1
to
7b61164
Compare
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Split the ssh-copy-id tool from the openssh package into a separate output. This mainly benefits macOS users because the version of openssh that is preintalled in macOS doesn't provide ssh-copy-id.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)