-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Draft: Add Nix Language #6198
base: main
Are you sure you want to change the base?
Draft: Add Nix Language #6198
Conversation
Oh, that's nice! |
compilerType=nix | ||
|
||
group.nix.compilers=nixdefault | ||
compiler.nixdefault.exe=/home/node/.nix-profile/bin/nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks incorrect... I don't think we can default to ~node. Is there a better location where this is usually installed system-wide? I guess that on NixOS this is somewhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little bit of a problem.
In Single-user nix installation, it gets installed in ~/.nix-profile/bin/nix.
In nixos, it gets symlinked to : /run/current-system/sw/bin/nix -> which is a symlink to the nix store nix
In multi-user nix installation, it gets installed in /nix/var/nix/profiles/default/bin/nix
I put there the path of the codespace where I was, but it could be a little tricky to select a safe default.
@@ -0,0 +1,62 @@ | |||
// Copyright (c) 2023, Compiler Explorer Authors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2024
You'll need a way to have the compiler installed without requiring to have nix installed in |
For syntax highlighting, you can have a look at what the recent Spice support does in 54dda76#diff-9ba956095db84c8673973ef74862cf5ec230c54bc0a7feb703f387bbbb52a05a |
This is quite easy, for this you actually don't need nix setup at 100%, you can use nixStatic, which is a statically-compiled nix binary ~25MB which is more than capable of using nix eval, since you don't actually want to build any derivation. So this can run on any linux distribution without needing nix groups/paths/permissions setup at all :) (Also, nix doesn't really care of the path you are calling it from) |
This PR tries to add NIX EVAL as a possible target for compiler-explorer.
This is a Draft, since I can't figure out yet how to add syntax highlighting to nix or the output.
For nix-language evaluation, I used: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-eval with output to json file.