diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..219ced1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +/flake.lock -diff +/manifest.toml -diff diff --git a/.gitignore b/.gitignore index fc5d8e3..e0b29b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,7 @@ -# ---> Elixir -/_build -/cover -/deps -/doc -/.fetch -erl_crash.dump -*.ez -*.beam -/config/*.secret.exs -.elixir_ls/ +/result +/.direnv +*.beam +*.ez +/build +erl_crash.dump diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..67c1102 Binary files /dev/null and b/flake.lock differ diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8b071c3 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "Gleamish"; + + inputs = { + nixpkgs.follows = "gleam2nix/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + gleam2nix.url = "github:mtoohey31/gleam2nix"; + }; + + outputs = { self, nixpkgs, flake-utils, gleam2nix }: { + overlays = rec { + expects-gleam2nix = final: _: { + Gleamish = final.buildGleamProgram { + src = builtins.path { path = ./.; name = "Gleamish-src"; }; + }; + }; + default = nixpkgs.lib.composeManyExtensions [ + gleam2nix.overlays.default + expects-gleam2nix + ]; + buildInputs = with nixpkgs; [ + tree-sitter-grammars.tree-sitter-gleam + ]; + }; + } // flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + overlays = [ self.overlays.default ]; + inherit system; + }; + inherit (pkgs) Gleamish mkShell; + in + { + packages.default = Gleamish; + + devShells.default = mkShell { + inputsFrom = [ Gleamish ]; + }; + }); +} diff --git a/gleam.toml b/gleam.toml new file mode 100644 index 0000000..c566ab8 --- /dev/null +++ b/gleam.toml @@ -0,0 +1,19 @@ +name = "gleamish" +version = "1.0.0" + +# Fill out these fields if you intend to generate HTML documentation or publish +# your project to the Hex package manager. +# +# description = "" +# licences = ["Apache-2.0"] +# repository = { type = "github", user = "username", repo = "project" } +# links = [{ title = "Website", href = "https://gleam.run" }] +# +# For a full reference of all the available options, you can have a look at +# https://gleam.run/writing-gleam/gleam-toml/. + +[dependencies] +gleam_stdlib = "~> 0.34 or ~> 1.0" + +[dev-dependencies] +gleeunit = "~> 1.0" diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..37eae7c Binary files /dev/null and b/manifest.toml differ diff --git a/src/gleamish.gleam b/src/gleamish.gleam new file mode 100644 index 0000000..953e75d --- /dev/null +++ b/src/gleamish.gleam @@ -0,0 +1,5 @@ +import gleam/io + +pub fn main() { + io.println("Hello from changeme!") +} diff --git a/test/gleamish_test.gleam b/test/gleamish_test.gleam new file mode 100644 index 0000000..3831e7a --- /dev/null +++ b/test/gleamish_test.gleam @@ -0,0 +1,12 @@ +import gleeunit +import gleeunit/should + +pub fn main() { + gleeunit.main() +} + +// gleeunit test functions end in `_test` +pub fn hello_world_test() { + 1 + |> should.equal(1) +}