This should help nix users start working on ziglings without the complexity of making sure they are on a supported version of zig and zls.
feat(nix): add nix flake #346
doprz/exercises:main into main
Thank you for linking the other PRs for reference!
I do agree with your statement:
Thank you for the suggestion! However, we typically avoid including configuration details in our exercises to keep them focused and straightforward.
Yes, although it is trivial to just run nix shell 'github:mitchellh/zig-overlay#master', this PR also ensures that zls is available in the dev shell and also makes sure that it's zig input matches the zig version used/defined via mitchellh/zig-overlay either via an overlay or overrideAttrs.
e.g.
overrideAttrs
zls = inputs.zls-overlay.packages.${system}.zls.overrideAttrs (finalAttrs: previousAttrs: {
nativeBuildInputs = [zig];
});
https://github.com/zigtools/zls/blob/master/flake.nix
#...
zls = pkgs.stdenvNoCC.mkDerivation {
name = "zls";
version = "master";
meta.mainProgram = "zls";
src = fs.toSource {
root = ./.;
fileset = fs.intersection (fs.fromSource (pkgs.lib.sources.cleanSource ./.)) (
fs.unions [
./src
./tests
./build.zig
./build.zig.zon
./deps.nix
]
);
};
nativeBuildInputs = [zig];
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?