Skip to content

Commit f9a9627

Browse files
template: add gleam project
1 parent 6a15f32 commit f9a9627

File tree

11 files changed

+146
-0
lines changed

11 files changed

+146
-0
lines changed

template/gleam/.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; https://editorconfig.org
2+
root = true
3+
4+
; default configuration
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
indent_style = unset
11+
12+
[{*.nix,flake.lock}]
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.{yml,yaml,toml}]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[*.md]
21+
indent_style = space
22+
indent_size = 2
23+
24+
[*.gleam]
25+
indent_style = space
26+
indent_size = 2

template/gleam/.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: main
2+
on:
3+
pull_request:
4+
branches: [main]
5+
push:
6+
branches: [main]
7+
env:
8+
CI_NIX_STORE: ~/nix
9+
CI_NIX_FLAKE: .#default
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Setup Nix
15+
uses: cachix/install-nix-action@v26
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Cache Nix
19+
uses: actions/cache@v4
20+
with:
21+
path: ${{ env.CI_NIX_STORE }}
22+
key: ${{ runner.os }}-nix-${{ hashFiles('flake.nix', 'flake.lock') }}
23+
- name: Lint
24+
run: |
25+
nix --store ${{ env.CI_NIX_STORE }} \
26+
develop ${{ env.CI_NIX_FLAKE }} --command \
27+
editorconfig-checker && echo "ok"

template/gleam/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.beam
2+
*.ez
3+
/build
4+
erl_crash.dump

template/gleam/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
run:
2+
@gleam run

template/gleam/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Gleam Project

template/gleam/flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

template/gleam/flake.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
description = "Gleam Project";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
5+
6+
outputs =
7+
{ nixpkgs, ... }:
8+
let
9+
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
10+
in
11+
{
12+
devShells = forAllSystems (
13+
system:
14+
let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
in
17+
{
18+
default = pkgs.mkShell {
19+
name = "gleam-project";
20+
shellHook = ''
21+
git config pull.rebase true
22+
${pkgs.neo-cowsay}/bin/cowsay -f sage "Gleam Project"
23+
'';
24+
buildInputs = with pkgs; [
25+
editorconfig-checker
26+
gleam
27+
];
28+
};
29+
}
30+
);
31+
};
32+
}

template/gleam/gleam.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://gleam.run/writing-gleam/gleam-toml/.
2+
3+
name = "gleamproject"
4+
version = "1.0.0"
5+
6+
[dependencies]
7+
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
8+
9+
[dev-dependencies]
10+
gleeunit = ">= 1.0.0 and < 2.0.0"

template/gleam/manifest.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file was generated by Gleam
2+
# You typically do not need to edit this file
3+
4+
packages = [
5+
{ name = "gleam_stdlib", version = "0.43.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "69EF22E78FDCA9097CBE7DF91C05B2A8B5436826D9F66680D879182C0860A747" },
6+
{ name = "gleeunit", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "F7A7228925D3EE7D0813C922E062BFD6D7E9310F0BEE585D3A42F3307E3CFD13" },
7+
]
8+
9+
[requirements]
10+
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
11+
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }

0 commit comments

Comments
 (0)