GithubHelp home page GithubHelp logo

manveru / gleam-nix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vic/gleam-nix

0.0 1.0 0.0 178 KB

Build Gleam with Nix.

Home Page: https://gleam.run

License: Apache License 2.0

Nix 99.74% Makefile 0.26%

gleam-nix's Introduction

Reproducible builds for Gleam.

Build history

nix is a purely functional package manager with fully-cacheable, to-the-byte reproducible builds.

This guide documents how people using the Nix package manager or NixOS systems can easily build every version of Gleam with just a single command.

Screen Shot 2021-12-20 at 18 31 47

Requirements

For using this guide you'll need nix version 2.8 or latter which must have the flakes feature enabled.

See nix quick-install or the install-nix tutorial for more in depth instructions.

Running Gleam nightly. (or any branch/commit)

The following command runs gleam --help on the build from the latest commit on main branch.

# The latest commit from Gleam's main branch. (can be a commit hash, tag or branch name)
nix shell github:vic/gleam-nix --override-input gleam github:gleam-lang/gleam/main -c gleam --help

Gleam maintainers can also use this to try PR experimental features from other contributors just by overriding where the Gleam source comes from specifying the repository/branch name.

# running gleam to try other people branches:
nix shell github:vic/gleam-nix --override-input gleam github:<someone>/gleam/<cool-feature> -c gleam --help

Developing Gleam with a Nix environment.

Also, for Gleam developers, using Nix ensures we get the same development environment in an instant, all you have to do is checkout the Gleam repo and run:

nix develop github:vic/gleam-nix --override-input gleam path:$PWD # -c fish # you might use your preferred shell
# open your editor and hack hack hack..
cargo build # build dependencies are loaded in your shell
# or 
nix run github:vic/gleam-nix --override-input gleam path:$PWD -- --help # runs your local `gleam --help`

flake.nix

[Nix flakes] are the secret sauce for nix reproducible builds. Since all build dependencies get hashed, even the source code. Every external dependency such external repos (e.g. nixpkgs), external utilities (e.g. cargo llvm make), and any Cargo.toml workspace dependency (read from Cargo.nix) gets hashed so that nix only builds what has actually changed.

If you edit the flake.nix file, for example to change the rust toolchain or the nixpkgs revision, run nix flake udpate afterwards to regenerate the lock file.

Regenerating Cargo.nix

From time to time the Cargo.nix file needs to be re-generated by using cargo2nix in order to keep Gleam's cargo deps nix-controlled.

make generate

gleam-nix's People

Contributors

manveru avatar vic avatar

Watchers

 avatar

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.