Skip to content
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

hss: init at 1.0.1 #25936

Merged
merged 2 commits into from
May 22, 2017
Merged

hss: init at 1.0.1 #25936

merged 2 commits into from
May 22, 2017

Conversation

nixy
Copy link
Contributor

@nixy nixy commented May 20, 2017

Motivation for this change

Adds hss, a simple SSH helper written in ruby to allow shorthand for a fleet of hosts.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

inherit ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just use gemdir = ./.; instead of the three lines above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, this seems simpler and works just the same. Thanks for the feedback :)

@Mic92
Copy link
Member

Mic92 commented May 20, 2017

Would it not also useful to replace https://github.com/akerl/hss/blob/master/bin/hss#L21 with a reference to the real ssh executable?

@nixy
Copy link
Contributor Author

nixy commented May 20, 2017

Yeah, now that I think about it that path should absolutely be replaced. I was a bit tired when I put this together, so I missed that.

What would be the best way to replace that line? I thought about using sed on the output in postInstall, but the path is very long and includes version numbers for ruby. It seems ill advised to do that. What phase would patching that make sense at? I looked around nixpkgs, but didn't find any examples of packages using bundlerEnv doing this kind of replacement.

@Mic92
Copy link
Member

Mic92 commented May 20, 2017

use substituteInPlace function in postPatch phase.

@nixy
Copy link
Contributor Author

nixy commented May 20, 2017

I tried a couple of things, but it looks like bundlerEnv doesn't support most of the normal phases and overrides. The only extra commands you can run are postBuild, at which point the files are already in place behind the ruby versions. So any code I place in a postInstall/postPatch doesn't get executed at all.

Replacing ssh here doesn't seem to be as easy I first thought. I can see a few examples in nixpkgs where bundlerEnv is tied into a stdenv.mkderivation, so I think I might refer to them to see what they did.

@Mic92 Mic92 merged commit c3f434f into NixOS:master May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants