{"id":15171841,"url":"https://github.com/kamilchm/go2nix","last_synced_at":"2026-01-14T21:13:27.824Z","repository":{"id":144202233,"uuid":"45417409","full_name":"kamilchm/go2nix","owner":"kamilchm","description":"Reproducible builds and development environment for Go","archived":true,"fork":false,"pushed_at":"2021-08-26T12:35:04.000Z","size":117,"stargazers_count":94,"open_issues_count":17,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-01T06:38:22.690Z","etag":null,"topics":["go","golang","golang-tools","nix","nixpkgs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamilchm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-02T19:38:24.000Z","updated_at":"2024-08-11T13:48:18.000Z","dependencies_parsed_at":"2023-06-18T05:15:23.805Z","dependency_job_id":null,"html_url":"https://github.com/kamilchm/go2nix","commit_stats":{"total_commits":84,"total_committers":13,"mean_commits":6.461538461538462,"dds":"0.33333333333333337","last_synced_commit":"d6315ed67d974555b46c3bce627abe00df59ecab"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kamilchm/go2nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamilchm%2Fgo2nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamilchm%2Fgo2nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamilchm%2Fgo2nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamilchm%2Fgo2nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamilchm","download_url":"https://codeload.github.com/kamilchm/go2nix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamilchm%2Fgo2nix/sbom","scorecard":{"id":548824,"data":{"date":"2025-08-11","repo":{"name":"github.com/kamilchm/go2nix","commit":"d6315ed67d974555b46c3bce627abe00df59ecab"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":4,"reason":"Found 9/22 approved changesets -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:   2 out of   2 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T10:14:38.418Z","repository_id":144202233,"created_at":"2025-08-20T10:14:38.419Z","updated_at":"2025-08-20T10:14:38.419Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","golang-tools","nix","nixpkgs"],"created_at":"2024-09-27T09:20:26.239Z","updated_at":"2026-01-14T21:13:27.801Z","avatar_url":"https://github.com/kamilchm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Circle CI](https://circleci.com/gh/kamilchm/go2nix.svg?style=shield)](https://circleci.com/gh/kamilchm/go2nix)\n\n# go2nix - nix packages for Go applications\n\ngo2nix is best suited for Go apps written before [dep](https://github.com/golang/dep) or [modules](https://github.com/golang/go/wiki/Modules) were introduced.\n\n- If you see a `Gopkgs.lock` file in the source try [dep2nix](https://github.com/nixcloud/dep2nix) instead.\n- If you see a `go.mod` file in the source try [vgo2nix](https://github.com/adisbladis/vgo2nix) or [gomod2nix](https://github.com/tweag/gomod2nix) instead.\n\n## For Nixers - packaging Go applications\n\n### Concept\n\n`go2nix` provides an autmatic way to create Nix derivations for Go applications.\n\n1. Start with app sources that can be built on your machine with `go build`.\n   It means that you need to get all dependencies into current `GOPATH`.\n2. Run `go2nix save` in application source dir where `main` package lives.\n   This will create 2 files `default.nix` and `deps.nix` that can be moved\n   into its own directory under `nixpkgs`.\n\n### Example\n\nIf you are not sure how to organize your directory structure, [read this official guide](https://golang.org/doc/code.html) first.\n\n\nOur project will be called `influxdb-demo` and this demo will be using the [influxdb client library](https://github.com/influxdata/influxdb/tree/master/client).\n\n1. But first, prepare the project directory:\n\n   ```sh\n   mkdir example\n   cd example\n   mkdir bin pkg src\n   ```\n\n2. Change into a `shell` environment which contains GO and GIT:\n\n   ```sh\n   nix-shell -p go git go2nix\n   ```\n\n   **Note**: Make sure `go2nix` is at least version 1.1.1\n\n3. Then set the `GOPATH`:\n\n   ```sh\n   export GOPATH=`pwd`\n   mkdir -p src/github.com/qknight/influxdb-demo\n   ```\n\n4. Prepare `src/github.com/qknight/influxdb-demo/influxdb-client.go`:\n\n   ```go\n   package main\n\n   import (\n       \"log\"\n       \"time\"\n\n       \"github.com/influxdata/influxdb/client/v2\"\n   )\n\n   const (\n       MyDB = \"square_holes\"\n       username = \"bubba\"\n       password = \"bumblebeetuna\"\n   )\n\n   func main() {\n       // Make client\n       c, err := client.NewHTTPClient(client.HTTPConfig{\n           Addr: \"http://localhost:8086\",\n           Username: username,\n           Password: password,\n       })\n\n       if err != nil {\n           log.Fatalln(\"Error: \", err)\n       }\n\n       // Create a new point batch\n       bp, err := client.NewBatchPoints(client.BatchPointsConfig{\n           Database:  MyDB,\n           Precision: \"s\",\n       })\n\n       if err != nil {\n           log.Fatalln(\"Error: \", err)\n       }\n\n       // Create a point and add to batch\n       tags := map[string]string{\"cpu\": \"cpu-total\"}\n       fields := map[string]interface{}{\n           \"idle\":   10.1,\n           \"system\": 53.3,\n           \"user\":   46.6,\n       }\n       pt, err := client.NewPoint(\"cpu_usage\", tags, fields, time.Now())\n\n       if err != nil {\n           log.Fatalln(\"Error: \", err)\n       }\n\n       bp.AddPoint(pt)\n\n       // Write the batch\n       c.Write(bp)\n   }\n   ```\n\n   **Note**: We use [go influxdb client](https://github.com/influxdata/influxdb/tree/master/client) as an external library example.\n\n5. Create a `GIT` repository\n\n   ```sh\n   cd src/github.com/qknight/influxdb-demo\n   git init\n   git add influxdb-client.go\n   git commit -m 'initial commit'\n   ```\n\n   Also create the repository on github.com, in this example it would be `github.com/qknight/influxdb-demo`\n\n   ```sh\n   git remote add origin git@github.com:qknight/influxdb-demo.git\n   git push -u origin master\n   ```\n\n   **Note:** `go2nix` requires a `GIT repository` to retrieve the `commit hash` and the `remote` so it can generate the values as `name`, `version`, `rev` and `goPackagePath` in the `default.nix` file.\n\n\n6. Download the dependency the go-way\n\n   ```sh\n   go get\n   ```\n\n   **Note:** `go get` will populate `src/github.com/influxdata/influxdb` for you.\n\n7. Building the project\n\n   ```sh\n   go build\n   ```\n\n8. Generate `default.nix`/`deps.nix`\n\n   If `go` was able to build the binary, use `go2nix` to derive the `default.nix` and `deps.nix`:\n\n   ```sh\n   go2nix save\n   ```\n\n   **Note:** This gives you a `default.nix` and a `deps.nix` which can be put into `nixpkgs` but, if you want to use it with `nix-shell`, you need some tiny adaptions.\n\n9. The `default.nix` file we generated\n\n   ```nix\n   # This file was generated by go2nix.\n   { stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:\n\n   buildGoPackage rec {\n     name = \"influxdb-demo-${version}\";\n     version = \"20161030-${stdenv.lib.strings.substring 0 7 rev}\";\n     rev = \"718c85cd733bca964abf03f5371c939d19845f72\";\n\n     goPackagePath = \"github.com/qknight/influxdb-demo\";\n\n     src = fetchgit {\n       inherit rev;\n       url = \"git@github.com:qknight/influxdb-demo.git\";\n       sha256 = \"0csbqcnncklimysgcbxlj190bynx1ppvyxvl5viz40fvbcj4l8xb\";\n     };\n\n     goDeps = ./deps.nix;\n\n     # TODO: add metadata https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes\n     meta = {\n     };\n   }\n   ```\n\n   **Note:** Update the `fetchgit url` to use `https` instead of `ssh` or `nix-build` won't be able to fetch the software later.\n\n   **Note:** If you want to use this `default.nix` in `nixpkgs` you should extend the [meta section](https://nixos.org/nixpkgs/manual/#chap-meta) and correct the `goPackagePath`.\n\n10. The `deps.nix` we generated\n\n    ```nix\n    # This file was generated by go2nix.\n    [\n      {\n        goPackagePath = \"github.com/influxdata/influxdb\";\n        fetch = {\n          type = \"git\";\n          url = \"https://github.com/influxdata/influxdb\";\n          rev = \"bcb48a8ff2e9c118d5cfa04f03a62134b9c414c7\";\n          sha256 = \"1f4jp7p2xxlsxhqbvglcl95y7fhab0w6zsvyqmqglmi0g1c5v21z\";\n        };\n      }\n    ]\n    ```\n\n11. Building the project using `nix-build`\n\n    ```sh\n    nix-build -E 'with import \u003cnixpkgs\u003e { };  callPackage ./default.nix {}'\n    ```\n\n    This will print something like this:\n\n    ```\n    these derivations will be built:\n      /nix/store/8naxqswyhsmhqhjzskz5q0nf33nvyzsf-influxdb-demo-718c85c.drv\n      /nix/store/p9bgjqn683xkmns36fpw2ipz5k57srl3-influxdb-bcb48a8.drv\n      /nix/store/k0q9k2wfq0ccdsy04pyg4l01iqh5j1aa-go1.7-influxdb-demo-20161030-718c85c.drv\n    building path(s) ‘/nix/store/45jjx5jakvlgwzq358pivr5x8xpgdsck-influxdb-bcb48a8’\n    building path(s) ‘/nix/store/pqlqq2wjgixvf5j6qmrv5qyjh1bc6i8q-influxdb-demo-718c85c’\n    exporting https://github.com/influxdata/influxdb (rev bcb48a8ff2e9c118d5cfa04f03a62134b9c414c7) into /nix/store/45jjx5jakvlgwzq358pivr5x8xpgdsck-influxdb-bcb48a8\n    exporting https://github.com/qknight/influxdb-demo.git (rev 718c85cd733bca964abf03f5371c939d19845f72) into /nix/store/pqlqq2wjgixvf5j6qmrv5qyjh1bc6i8q-influxdb-demo-718c85c\n    Initialized empty Git repository in /nix/store/45jjx5jakvlgwzq358pivr5x8xpgdsck-influxdb-bcb48a8/.git/\n    Initialized empty Git repository in /nix/store/pqlqq2wjgixvf5j6qmrv5qyjh1bc6i8q-influxdb-demo-718c85c/.git/\n    remote: Counting objects: 3, done.        \n    remote: Compressing objects: 100% (2/2), done.        \n    remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0        \n    From https://github.com/qknight/influxdb-demo\n    * branch            HEAD       -\u003e FETCH_HEAD\n    Switched to a new branch 'fetchgit'\n    removing `.git'...\n    remote: Counting objects: 540, done.        \n    remote: Compressing objects: 100% (506/506), done.        \n    remote: Total 540 (delta 34), reused 179 (delta 6), pack-reused 0        \n    Receiving objects: 100% (540/540), 1.44 MiB | 0 bytes/s, done.\n    Resolving deltas: 100% (34/34), done.\n    From https://github.com/influxdata/influxdb\n    * branch            HEAD       -\u003e FETCH_HEAD\n    Switched to a new branch 'fetchgit'\n    removing `.git'...\n    building path(s) ‘/nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin’, ‘/nix/store/av17zlfgnppl704wwxnh5pjpkcxac9k3-go1.7-influxdb-demo-20161030-718c85c’\n    unpacking sources\n    unpacking source archive /nix/store/pqlqq2wjgixvf5j6qmrv5qyjh1bc6i8q-influxdb-demo-718c85c\n    source root is influxdb-demo-718c85c\n    patching sources\n    configuring\n    grep: Invalid range end\n    unpacking source archive /nix/store/45jjx5jakvlgwzq358pivr5x8xpgdsck-influxdb-bcb48a8\n    building\n    github.com/influxdata/influxdb/pkg/escape\n    github.com/influxdata/influxdb/models\n    github.com/influxdata/influxdb/client/v2\n    github.com/qknight/influxdb-demo\n    installing\n    /tmp/nix-build-go1.7-influxdb-demo-20161030-718c85c.drv-0/go /tmp/nix-build-go1.7-influxdb-demo-20161030-718c85c.drv-0\n    /tmp/nix-build-go1.7-influxdb-demo-20161030-718c85c.drv-0\n    post-installation fixup\n    shrinking RPATHs of ELF executables and libraries in /nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin\n    shrinking /nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin/bin/influxdb-demo\n    stripping (with flags -S) in /nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin/bin \n    patching script interpreter paths in /nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin\n    shrinking RPATHs of ELF executables and libraries in /nix/store/av17zlfgnppl704wwxnh5pjpkcxac9k3-go1.7-influxdb-demo-20161030-718c85c\n    patching script interpreter paths in /nix/store/av17zlfgnppl704wwxnh5pjpkcxac9k3-go1.7-influxdb-demo-20161030-718c85c\n    /nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin\n    ```\n\n    **Note**: The resulting binary will be in `/nix/store/9k4v7rhs5606fyia8mb341k71m3yrcbq-go1.7-influxdb-demo-20161030-718c85c-bin`.\n\n\n12. Enabling `nix-shell`\n\n    In order to use `nix-shell` you need to create a `shell.nix` file:\n         \n    ```nix\n    let\n      pkgs = import \u003cnixpkgs\u003e {};\n    in pkgs.callPackage ./default.nix {}\n    ```\n    \n    That will pass the derivations for `stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn` into your package derivation. It will use `nixpkgs` (your current channel).\n\n\n    After you updated the `default.nix` you can now use `nix-shell`:\n\n    ```\n    nix-shell\n    these paths will be fetched (47.89 MiB download, 248.86 MiB unpacked):\n      /nix/store/28wl3f34vfjpw0y5809bgr6382wqdscf-bash-4.3-p48\n      /nix/store/7bdn99q835l042d8kcrn7yk61zkcqw6y-go1.7-govers-20150109-3b5f175\n      /nix/store/aql31436x2fgr3rdj4fwbrgkvzw2kqf4-iana-etc-2.30\n      /nix/store/bb2njjq32bh1wl2nl1zss0i8w1w2jgrz-tzdata-2016f\n      /nix/store/dp2nf60lqzy1kbhd78ndf5nm3fb3qicd-gcc-wrapper-5.4.0\n      /nix/store/drfmgb3kd3clxzi919mjrq5cnkw575w0-stdenv\n      /nix/store/fkzyjrmrxv1zgswdq327h11ifbxdfpf9-go1.7-govers-20150109-3b5f175-bin\n      /nix/store/g1pacy3pmx9r846z87xysfs29jz2b42q-parallel-20160722\n      /nix/store/g4f1bms36hgg5abfd8xc4bj6sfzsy61d-bash-4.3-p48-info\n      /nix/store/i76bwv541a7zj576hkdia62169r2nl0z-bash-4.3-p48-doc\n      /nix/store/jqa9bh404crcxnyxa2lkffag7kw3yxw3-go-1.7.1\n      /nix/store/jx5fyfd6mkpib1dmgy5rjirxff5vaczm-procps-3.3.11\n      /nix/store/kx62kzlxcmzxgnxz1c95x7gln72iqd90-ncurses-6.0\n      /nix/store/njn6il2fwaycjkd0jxbfj22gb25nd5df-perl-5.22.2\n    fetching path ‘/nix/store/i76bwv541a7zj576hkdia62169r2nl0z-bash-4.3-p48-doc’...\n    fetching path ‘/nix/store/g4f1bms36hgg5abfd8xc4bj6sfzsy61d-bash-4.3-p48-info’...\n    fetching path ‘/nix/store/aql31436x2fgr3rdj4fwbrgkvzw2kqf4-iana-etc-2.30’...\n    fetching path ‘/nix/store/bb2njjq32bh1wl2nl1zss0i8w1w2jgrz-tzdata-2016f’...\n    ...\n    ```\n\n    After the dependencies were built you can now use: `go build` to build your software as usual!\n\n    **Note:** You can also arrange a `default.nix` so that it can be used by `nixpkgs` and `nix-shell` but this is not covered here.\n\n\n### Example Leaps\n\nSome projects are built using `go get github.com/jeffail/leaps/cmd/...` and for these you need to identify the `src` directory to run `go2nix save` from. So here is another example:\n\n1. `nix-shell -p go2nix git go`\n2. `cd $(mktemp -d)`\n3. `export GOPATH=$(pwd)`\n4. `go get github.com/jeffail/leaps/cmd/...`\n5. `cd src/github.com/jeffail/leaps/cmd/leaps`\n6. `go2nix save`\n\n**Note:** The resulting `default.nix` and `deps.nix` are created in the directory you are currently in.\n\n# Installation\n\nThe preferred way of installing `go2nix` is to use `nix` like `nix-env -iA go2nix` or using it declaratively.\n\nBut you can also use `go get github.com/kamilchm/go2nix`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamilchm%2Fgo2nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamilchm%2Fgo2nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamilchm%2Fgo2nix/lists"}