Created
March 26, 2025 13:52
-
-
Save Comamoca/bfe0ffd9bb656f3b043878c0b152dacb to your computer and use it in GitHub Desktop.
An example flake for build latest gleam.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
description = "An example flake for build latest gleam."; | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable"; | |
flake-parts.url = "github:hercules-ci/flake-parts"; | |
systems.url = "github:nix-systems/default"; | |
devenv.url = "github:cachix/devenv"; | |
rust-overlay.url = "github:oxalica/rust-overlay"; | |
}; | |
outputs = | |
inputs@{ | |
self, | |
systems, | |
nixpkgs, | |
flake-parts, | |
... | |
}: | |
flake-parts.lib.mkFlake { inherit inputs; } { | |
imports = [ | |
inputs.devenv.flakeModule | |
]; | |
systems = import inputs.systems; | |
perSystem = | |
{ | |
config, | |
pkgs, | |
system, | |
... | |
}: | |
let | |
rustPlatform = pkgs.makeRustPlatform { | |
cargo = pkgs.rust-bin.nightly.latest.default; | |
rustc = pkgs.rust-bin.nightly.latest.default; | |
}; | |
gleam = rustPlatform.buildRustPackage rec { | |
pname = "gleam"; | |
version = "1.9.1"; | |
src = pkgs.fetchFromGitHub { | |
owner = "gleam-lang"; | |
repo = "gleam"; | |
rev = "v${version}"; | |
hash = "sha256-6vYVUdQST49TNctO9Y/XrRFyJ6hXng85SsO+4JBn1GA="; | |
}; | |
useFetchCargoVendor = true; | |
cargoHash = "sha256-arVtNxcYDVKRTGe9won6zb30wCxMD6MtsGs25UmOPjM="; | |
auditable = false; | |
doCheck = false; | |
}; | |
in | |
{ | |
_module.args.pkgs = import inputs.nixpkgs { | |
inherit system; | |
overlays = [ | |
inputs.rust-overlay.overlays.default | |
]; | |
config = { }; | |
}; | |
devenv.shells.default = { | |
packages = [ pkgs.nil ]; | |
languages = { | |
gleam = { | |
enable = true; | |
package = gleam; | |
}; | |
}; | |
enterShell = ''''; | |
}; | |
packages.default = gleam; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment