Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake support #549

Merged
merged 4 commits into from
Jul 19, 2022
Merged

Add flake support #549

merged 4 commits into from
Jul 19, 2022

Conversation

leroycep
Copy link
Contributor

@leroycep leroycep commented Jul 19, 2022

This pull request will add flake.nix, flake.lock, and a build option -Dknown-folders=<path> to override the path to the known-folders package.

Will allow zls to be run like so:

nix run github:zigtools/zls 

Or used in another flake:

{
    inputs.zls.url = "github:zigtools/zls";
    outputs = { self, zls}: {
        # flake stuff here
    };
}

Have to use it with `nix run '.?submodules=1'`, unfortunately.

Might be able to remove that requirement by using the following, but I
don't know how it interacts with `gitignoreSource`:

```
fetchGit {
  url = ./.;
  submodules = true;
}
```
This allows the flake to work without passing in `?submodules=1`, which
makes it easy to include in other flakes.

This commit also makes it possible to override the path to the
`known-folders` package like so:

```
zig build -Dknown-folders=/path/to/known-folders.zig
```

This allows `flake.nix` to pass in the nix store path.
Simpler than using `fetchFromGitHub`, we can have `nix` manage the
version instead
@SuperAuguste
Copy link
Member

LGTM, thank you!

@SuperAuguste SuperAuguste merged commit ab62e58 into zigtools:master Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants