Closed copumpkin closed 7 years ago
Generally, go2nix
should be run in the same dir where you normally do go build
. In your case it should be agent
as you did.
amazon-ssm-agent
provides it's dependencies in vendor
dir and doesn't need any external one, so the empty deps.nix
file.
One thing I found strange is the location of vendor/src/github.com
instead of vendor/github.com
. It works good for me when I move it manually.
Wrapping up, there's a nix derivation for amazon-ssm-agent
that works for me https://gist.github.com/kamilchm/4c07366c0fcec8c9974ae93e07ef3552
Awesome, thanks! I'll try it out later and push it to nixpkgs crediting you :)
On Feb 9, 2017, at 10:13, Kamil Chmielewski notifications@github.com wrote:
Generally, go2nix should be run in the same dir where you normally do go build. In your case it should be agent as you did. amazon-ssm-agent provides it's dependencies in vendor dir and doesn't need any external one, so the empty deps.nix file. One thing I found strange is the location of vendor/src/github.com instead of vendor/github.com. It works good for me when I move it manually. Wrapping up, there's a nix derivation for amazon-ssm-agent that works for me https://gist.github.com/kamilchm/4c07366c0fcec8c9974ae93e07ef3552
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I might say too much in "that works for me" - I meant it compiles and I can run the output binary :) Looking closer, there could be few places to patch or configure before merging into nixpkgs:
$ /nix/store/wjilplwya3y7yl5q1kf0mgsj99xqdc6l-amazon-ssm-agent-2.0.633.0-bin/bin/agent --help
2017/02/09 17:40:30 Failed to load instance info from vault. Failed to create vault folder. failed to create directory /var/lib/amazon/ssm/Vault/Store. mkdir /var/lib/amazon: permission denied
Error occured fetching the seelog config file path: open /etc/amazon/ssm/seelog.xml: no such file or directory
Oh yeah, definitely plan on doing that. Although with a NixOS module we'd probably just make sure it gets the right locations from NixOS config.
Thanks again! I have the SSM agent working on NixOS and wrote a simple module for it too. I forgot to credit you for the original expression in my initial commit though, sorry 😦 I can't rewrite history now but if you'd like credit I can add a comment or something.
It's OK. Good to know that it works.
I'm trying to package the AWS SSM agent with go2nix and am running into some trouble. I'm following the instructions in the go2nix readme and have wrangled the project into building for me, but when I type
go2nix save
, I getWhich is presumably because the Go sources are in a subdirectory. I cd into
agent
, which contains all the go sources, and in therego2nix save
works just fine but produces an empty deps.nix. How do I convincego2nix
to find my source files and my dependencies?