Git Product home page Git Product logo

Comments (3)

qknight avatar qknight commented on May 26, 2024 1

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.

qknight avatar qknight commented on May 26, 2024 1

@kamilchm might interest you, i've hacked https://github.com/nixcloud/dep2nix together

from go2nix.

kamilchm avatar kamilchm commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.