Comments (3)
i've hacked together this script and it is a helper in getting the deps together.
using https://github.com/nixcloud/nix-beautify we can now generate nice and unique deps.nix files:
uniqueDeps.sh
#!/usr/bin/env bash
#https://groups.google.com/forum/#!topic/golang-nuts/611QEJqkDKw
#deps=$(go list -f {{.Deps}})
pushd nixcloud.io/auth-server/
deps=$(go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}} ' | sort | uniq)
popd
rm -Rf mydeps
mkdir mydeps
for i in $deps; do
echo $i
pushd $i
go2nix save
popd
d=$(echo $i | base64)
cp $i/deps.nix mydeps/$d.nix
done
pushd mydeps
cat * | grep -v '\[' | grep -v '\]' | grep -v "This file was generated" > deps.nix
echo '[' > deps.nix_
cat deps.nix >> deps.nix_
echo ']' >> deps.nix_
mv deps.nix_ deps.nix
nix-instantiate --eval --strict -E 'let pkgs=import <nixpkgs>{}; in pkgs.lib.unique (import ./deps.nix)' | sed -e 's/};/};\n/g' | sed -e 's/} /}\n/g' | sed -e 's/{/{\n/g' | sed -e 's/; /;\n/g' > deps.nix_
popd
cat deps.nix_ | nix-beautify > deps.nix
from go2nix.
@kamilchm might interest you, i've hacked https://github.com/nixcloud/dep2nix together
from go2nix.
I'm less in Go now and I couldn't find time to complete my dep
branch. I'm glad someone did it 👍
from go2nix.
Related Issues (20)
- version naming conventions HOT 1
- Support for gb manifest files HOT 2
- Unclear what `go2nix save` is looking for HOT 6
- Gopath detection broken HOT 2
- New release? HOT 2
- Undeclared dependency on nix-prefetch-git HOT 1
- Missing dependencies on Siad HOT 1
- Only imported used VCS's
- Add flag to configure target file. HOT 1
- How to generate expressions for Hugo? HOT 2
- Help generating a package for Leanote HOT 4
- Cannot work out how to package rabbitmq-explorer HOT 5
- Does the package need to be a git repository? HOT 3
- nix-prefetch-git fails without NIX_REMOTE being set (nix 2.0)
- Improve documentation on where to run go2nix HOT 1
- Mention dep2nix HOT 5
- Unable to find vendored packages HOT 1
- Request a better error reporting
- go2nix probably can't be called in a builder because nix-prefetch-git wants access to the store HOT 2
- Cannot find branch of package HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go2nix.