Skip to content

Commit

Permalink
feat: add nix-shell and direnv support (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
hall authored Aug 15, 2022
1 parent ec020d7 commit d78b62d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,5 @@ paket-files/

# some misc. proj. files
.local/

.direnv/
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"connor4312.esbuild-problem-matchers"
"connor4312.esbuild-problem-matchers",
"mkhl.direnv"
]
}
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Adds [nix](https://nixos.org/) language support for VSCode Editor.

* When `Language Server` support is not enabled the following tools are used to
+ Formatting support. Set `nix.formatterPath` to any command which can accept file contents on stdin and return formatted text on stdout; e.g.,
```json
```jsonc
{
"nix.formatterPath": "nixpkgs-fmt" // default
// "nix.formatterPath": "nixfmt"
Expand All @@ -44,7 +44,7 @@ Adds [nix](https://nixos.org/) language support for VSCode Editor.

### Visual Studio Code

Hit `F1` and enter the `ext install jnoortheen.nix-ide` command or search for `nix-ide` .
Hit `F1` and enter the `ext install jnoortheen.nix-ide` command or search for `nix-ide`.

### *.vsix file

Expand All @@ -65,19 +65,23 @@ Just clone the [GitHub repository](https://github.com/bbenoist/vscode-nix) under

## Development

* TypeScript is used to develop the extension
There is [direnv](https://direnv.net/) and [nix-shell](https://nixos.wiki/wiki/Development_environment_with_nix-shell) support so a dev environment can be created with the `nix-shell` command or a one-time `direnv allow` at the root of the repo.

Press `F5` in VSCode to run an Extension Development Host instance with the extension installed.

TypeScript is used to develop the extension.

```sh
yarn install
yarn build # this will build the extension
yarn install # install dependencies
yarn build # build the extension
```

## Releasing a new version

* fill `.env` from `.env.template`

```sh
yarn env-cmd
yarn env-cmd
yarn release
```

Expand Down
11 changes: 11 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs-16_x
yarn
esbuild
];
shellHook = ''
yarn install
'';
}

0 comments on commit d78b62d

Please sign in to comment.