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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
echoip: Init at unstable-2018-11-20 #50965
Conversation
5aa2bda
to
0a021c6
Compare
Example usage: https://github.com/rvolosatovs/infrastructure/blob/fae0779f897a527a628f5faeca88bcb61df12be4/nixos/echoip.nix#L17 |
0a021c6
to
46ec936
Compare
...And fixed a typo |
To be fair that sounds kind of scary 馃槃 Tried to build it and got
So I think one of the hashes in the |
Corrected the hash manually just to test with https://github.com/rvolosatovs/infrastructure/blob/fae0779f897a527a628f5faeca88bcb61df12be4/nixos/echoip.nix#L17 and it does work. A NixOS module would be nice too, but it's not required. |
Regarding the module: Regarding the hash: {
"url": "https://github.com/oschwald/geoip2-golang",
"rev": "7118115686e16b77967cdbf55d1b944fe14ad312",
"date": "2018-02-22T13:45:52-08:00",
"sha256": "0zpgpz577rghvgis6ji9l99pq87z5izbgzmnbyn3dy533bayrgpw",
"fetchSubmodules": false
} And {
"url": "https://github.com/oschwald/geoip2-golang",
"rev": "7118115686e16b77967cdbf55d1b944fe14ad312",
"date": "2018-02-22T13:45:52-08:00",
"sha256": "0d3kykb1xqh4a1qkpsbl7bbk1pcffshj2dvp5b3xrhyvxfs2cdxs",
"fetchSubmodules": true
} I tried to turn the dependency in {
goPackagePath = "github.com/oschwald/geoip2-golang";
fetch = {
type = "git";
url = "https://github.com/oschwald/geoip2-golang";
rev = "7118115686e16b77967cdbf55d1b944fe14ad312";
sha256 = "0zpgpz577rghvgis6ji9l99pq87z5izbgzmnbyn3dy533bayrgpw";
fetchSubmodules = false;
};
} But that does not seem to help and submodules are still pulled in.(and, hence, there's a hash mismatch). Any ideas on how to fix this? |
rg 'fetchSubmodules|submodule' $(find $(nix eval '(<nixpkgs>)') -name 'deps.nix') Does not find anything either, is it not possible to control the submodule fetching in go package builds? |
46ec936
to
56a52b3
Compare
Looking at the dep2src = goDep:
{
inherit (goDep) goPackagePath;
src = if goDep.fetch.type == "git" then
fetchgit {
inherit (goDep.fetch) url rev sha256;
}
... It doesn't care about If you want to you can work around this by changing the fetch type to {
goPackagePath = "github.com/oschwald/geoip2-golang";
fetch = {
type = "FromGitHub";
owner = "oschwald";
repo = "geoip2-golang";
rev = "7118115686e16b77967cdbf55d1b944fe14ad312";
sha256 = "0zpgpz577rghvgis6ji9l99pq87z5izbgzmnbyn3dy533bayrgpw";
};
} (hash retrieved from |
56a52b3
to
70050d7
Compare
@worldofpeace implemented the workaround |
70050d7
to
ce22ec5
Compare
Still getting a hash issue so I think the
|
@rvolosatovs |
Motivation for this change
The power behind https://ifconfig.co now in
nixpkgs
馃帀The project uses go modules - I did not find an automated solution to convert the go module files intodeps.nix
, so I first converted it to usedep
, then useddep2nix
to generate thedeps.nix
.Still had to do some manual tweaking to make it build, however, as
golang.org/x/sys
was not included indeps.nix
by some reason.Turns out https://github.com/adisbladis/vgo2nix exists, so I just used the tool to generate
deps.nix
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)