{"id":16318651,"url":"https://github.com/vic/gleam-nix","last_synced_at":"2025-03-22T21:31:50.631Z","repository":{"id":66386273,"uuid":"440343437","full_name":"vic/gleam-nix","owner":"vic","description":"Build Gleam with Nix.","archived":false,"fork":false,"pushed_at":"2024-08-20T11:57:00.000Z","size":170,"stargazers_count":20,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T22:24:11.655Z","etag":null,"topics":["gleam","nix","nix-flake"],"latest_commit_sha":null,"homepage":"https://gleam.run","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vic.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2021-12-21T00:26:02.000Z","updated_at":"2024-09-06T11:16:40.000Z","dependencies_parsed_at":"2023-12-16T22:32:55.572Z","dependency_job_id":null,"html_url":"https://github.com/vic/gleam-nix","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fgleam-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fgleam-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fgleam-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vic%2Fgleam-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vic","download_url":"https://codeload.github.com/vic/gleam-nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221839841,"owners_count":16889679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gleam","nix","nix-flake"],"created_at":"2024-10-10T22:24:12.728Z","updated_at":"2025-03-22T21:31:50.610Z","avatar_url":"https://github.com/vic.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gleam on Nix\n\nThis repo provides packages and [development shells][devshell] for\nworking with [Gleam] projects using Nix.\n\n## Usage\n\n```\n# running `gleam --version`\n$ nix run github:vic/gleam-nix -- --version\ngleam 1.9.0\n\n# you can also override to use any gleam revision (commit,branch,release) and any rust version (prefer stable releases)\n$ nix run github:vic/gleam-nix --override-input gleam github:gleam-lang/gleam/v1.9.1 --override-input rust-manifest file+https://static.rust-lang.org/dist/channel-rust-1.85.0.toml -- --version\ngleam 1.9.1\n```\n\n\u003e For previous versions see [Historic Builds](https://github.com/vic/gleam-nix/wiki/Historic-Builds)\n\n### Hack with Gleam\n\nIf you are creating a new awesome project with Gleam,\nthis flake can provide you with a development environment\ncontaining `gleam` and two of its run-times: `erlang` and `nodejs`.\n\n```\n$ nix run github:vic/gleam-nix -- new my-new-project\n$ cd my-new-project\n$ nix develop github:vic/gleam-nix -c $SHELL -l\n```\n\nIf you are using [direnv], create an `.envrc` file with\nthe following content:\n\n```shell\n# .envrc\nuse flake github:vic/gleam-nix\n```\n\n### Hack on Gleam\n\nIf you are willing to contribute to Gleam development,\nthis flake can provide you an entire development environment\nready for you to focus only on making Gleam awesome.\n\n```shell\n$ git clone https://github.com/gleam-lang/gleam\n$ cd gleam\n$ nix develop github:vic/gleam-nix#hack-on-gleam --override-input gleam \"path:$PWD\" -c $SHELL -l\n```\n\nIf you are using [direnv], create an `.envrc` file with\nthe following content:\n\n```shell\n# .envrc\nuse flake github:vic/gleam-nix#hack-on-gleam --override-input gleam \"path:$PWD\"\n```\n\n### Hack on this repo\n\n```shell\n$ nix develop .#hack-on-gleam-nix -c $SHELL -l\n```\n\nIf you are using [direnv] this repo already contains an `.envrc` you can load.\n\n## Contributing\n\nYes, please :).\n\nSee [hack-on-gleam-nix](devshells/hack-on-gleam-nix.md)\n\nTry not to change `gleam` pinned release unless it no longer builds with\nthe current Rust toolchain. In that case, update the `rust-manifest` input\n*and* the `gleam` pinned release. And please update [Historic Builds](https://github.com/vic/gleam-nix/wiki/Historic-Builds) with the range of known versions able to build.\n\n## FAQ\n\n- How is this different from the `gleam` package provided by `nixpkgs`.\n\n  This flake existed before we had an official `gleam` package on `nixpkgs`.\n  And most people would indeed only use that package.\n\n  However, for gleam hackers, this flake would be better suited since\n  it provides a development shell with dependencies based on Gleam's source.\n\n  Also people trying to use a more recent or experimental version of Gleam\n  will benefit from this flake.\n\n- I'm getting a `option 'allow-import-from-derivation' is disabled` error.\n\n  Old versions of this repo bundled a `Cargo.nix` file containing all of Gleam's\n  dependencies in order for nix to know how to fetch them and how to build the\n  Gleam cargo workspace.\n\n  However, one inconvenience of this was that the `Cargo.nix` file was tied to\n  a particular Gleam revision, and since Gleam is improving quite rapidly, it\n  was not uncommon to find the `Cargo.nix` file on this repo being outdated with\n  respect to Gleam's source code.\n\n  People had to regularly re-create the `Cargo.nix` file with `cargo2nix`.\n\n  Now, instead of using `cargo2nix`, we use `crate2nix` which allows us to generate\n  the `Cargo.nix` file as part of the build. Thus not requiring we to bundle it\n  on this repo, and prevent it from getting outdated. One advantage is that using\n  `--override-input gleam \u003csome-gleam-url\u003e` will automatically generate `Cargo.nix`\n  for that particular gleam revision.\n\n  This repo will only need to be updated when we have to bump the rust toolchain\n  as expected by Gleam.\n\n  On the other side, by not bundling a `Cargo.nix`, building with `crate2nix`\n  requires the `allow-import-from-derivation` nix option to be enabled.\n\n  This flake enables this option as part of `flake.nix` and will\n  be activated if you are listed as trusted-user in your `nix.conf` or\n  provide `--accept-flake-config` explicitly.\n\n[devshell]: https://numtide.github.io/devshell\n[direnv]: https://direnv.net\n[gleam]: https://gleam.run\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fgleam-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvic%2Fgleam-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvic%2Fgleam-nix/lists"}