Skip to content

Commit

Permalink
rename import from nix -> import in nix
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Apr 26, 2024
1 parent 9a9fefb commit 6deba78
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- [Project Structure](./using-compiler/project-structure.md)
- [Project Configuration](./using-compiler/project-configuration.md)
- [Recipes](./recipes/README.md)
- [Import a package from Nix](./recipes/import-from-nix.md)
- [Import a Gleam package in Nix](./recipes/import-in-nix.md)
- [Overriding incompatible packages](./recipes/overriding-packages.md)

# Nix
Expand Down
2 changes: 1 addition & 1 deletion src/getting-started/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ After [installing the Glistix compiler,](./installation.md) here's how you can s

Nice! Your project is now **ready to be used** by both Nix users (which will use your Gleam code compiled to Nix) and also other Glistix users.

To **import a Gleam module in your project from within Nix,** the `default.nix` and `flake.nix` files in your new project export a `lib.loadGlistixPackage { module = "module/name"; }` function, which, when used, will give you an attribute set with all names exported by that module, so you can use its record constructors, constants and functions from within Nix. See ["Import a package from Nix"](../recipes/import-from-nix.md) for more information.
To **import a Gleam module in your project from within Nix,** the `default.nix` and `flake.nix` files in your new project export a `lib.loadGlistixPackage { module = "module/name"; }` function, which, when used, will give you an attribute set with all names exported by that module, so you can use its record constructors, constants and functions from within Nix. See ["Import a Gleam package in Nix"](../recipes/import-in-nix.md) for more information.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Import a package from Nix
# Import a Gleam package in Nix

Great, you've made an awesome Glistix project which you now **want to use in Nix,** maybe for some Nix derivation you're configuring in some other repository, or for your NixOS configuration, for example. Your `main` function under `src/packagename.gleam` is ready and returns some functions and values in an attribute set which you plan to use in those projects (again an example).

Expand Down
2 changes: 1 addition & 1 deletion src/using-compiler/command-line-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Here are some of the most common compiler commands.
1. `glistix new`: An essential command, creates a new Glistix project for you with batteries included, containing:
- Several basic directories and files of the project structure expected by the compiler (see ["Project structure"](./project-structure.md));
- This includes an initial `gleam.toml` tuned for Glistix-specific defaults.
- An initial `flake.nix` (see ["Import a package from Nix"](../recipes/import-from-nix.md));
- An initial `flake.nix` (see ["Import a Gleam package in Nix"](../recipes/import-in-nix.md));
- An initial Git repository with a `.gitignore` file.

2. `glistix build [--target nix]`: Builds your project to `build/dev/<target>`, by default the target specified in your `gleam.toml` unless you specify `--target <target>`.
Expand Down
2 changes: 1 addition & 1 deletion src/using-compiler/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ is called when running `gleam test`. Use this with [`glistix_gleeunit`](https://
4. `priv/` is an optional folder for assets and other general files needed by your project and is not present by default. It is, however, symlinked to `build/dev/<target>/<package>` upon build.
5. `external/` is an optional folder for **external dependencies cloned locally as Git submodules** (see ["Overriding incompatible packages"](../recipes/overriding-packages.md)).

Additionally, some projects may opt into creating an `output/` folder to cache build output for ease of use from Nix (see ["Import a package from Nix"](../recipes/import-from-nix.md)).
Additionally, some projects may opt into creating an `output/` folder to cache build output for ease of use from Nix (see ["Import a Gleam package in Nix"](../recipes/import-in-nix.md)).

0 comments on commit 6deba78

Please sign in to comment.