Skip to content

Commit

Permalink
move system warning
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Apr 26, 2024
1 parent 5bd1f3b commit df08605
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ let
in { inherit mainOutput otherFunction; } # The sky is the limit!
```
> [!WARNING]
>
> When in pure evaluation mode (e.g. in Flakes without `--impure`), you will have to specify the system in `package.lib.loadGlistixPackage { system = "system name"; }` (e.g. `"x86_64-linux"`), as the package would have to be built using a Glistix derivation (which depends on the system), **unless that package caches build output** as explained in the section below (in which case the system isn't necessary at all, as the Nix files are ready to be imported, so no build occurs).
#### Build caching
You can optionally **cache the built Nix files in your repository** (or somewhere else) so Nix users **don't depend on the Glistix compiler to import your Glistix project** (if they don't have Glistix installed already, **the compiler will be compiled from scratch, which can take several minutes**). To do so, you can create an `output` folder in your repository and, **after each (relevant) build** with `glistix build --target nix`, run:
Expand Down Expand Up @@ -264,10 +268,6 @@ The Glistix project officially maintains a few ports of core Gleam packages to w
Great job! You now have a basic project up and running. You can **import its modules from Nix** by importing `default.nix` elsewhere (or adding your project's repository as an input to another `flake.nix` elsewhere) and using `lib.loadGlistixPackage { }` (or `{ module = "module/name"; }` to pick a module). You can also cache the build folder in your repository by copying it to `output`, as [described in the previous sections](#build-caching).
> [!WARNING]
>
> When in pure evaluation mode (e.g. in Flakes without `--impure`), you will have to specify the system in `package.lib.loadGlistixPackage { system = "system name"; }` (e.g. `"x86_64-linux"`), as the package would have to be built using a Glistix derivation (which depends on the system), **unless the package you're using caches build output** (in which case the system isn't necessary at all, as the Nix files are ready to be imported, so no build occurs).
[Check out the Glistix book](https://glistix.github.io/book/getting-started/basic-usage.html) for more information!
### Using Glistix within editors / with Gleam LSP
Expand Down

0 comments on commit df08605

Please sign in to comment.