-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
25 lines (24 loc) · 1.06 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let
unstable = import (fetchTarball https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz) { };
in
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = [
unstable.deno
unstable.jq
];
shellHook = ''
echo "
Updating .vscode to point to use nix deno $(which deno)
and setup formatting on save
"
mkdir -p .vscode
[ -s .vscode/settings.json ] || echo {} > .vscode/settings.json
echo "$(jq ".\"deno.path\" |= \"$(which deno)\"" .vscode/settings.json)" > .vscode/settings.json
echo "$(jq ".\"deno.enable\" |= true" .vscode/settings.json)" > .vscode/settings.json
echo "$(jq ".\"deno.lint\" |= true" .vscode/settings.json)" > .vscode/settings.json
echo "$(jq ".\"editor.defaultFormatter\" |= \"denoland.vscode-deno\"" .vscode/settings.json)" > .vscode/settings.json
echo "$(jq ".\"editor.formatOnSave\" |= true" .vscode/settings.json)" > .vscode/settings.json
'';
}