Skip to content

Commit f74cb29

Browse files
committed
update dev.nix
1 parent e956521 commit f74cb29

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

Diff for: .idx/dev.nix

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# To learn more about how to use Nix to configure your environment
2+
# see: https://developers.google.com/idx/guides/customize-idx-env
3+
{ pkgs, ... }: {
4+
# Which nixpkgs channel to use.
5+
channel = "stable-24.05"; # or "unstable"
6+
7+
# Use https://search.nixos.org/packages to find packages
8+
packages = [
9+
pkgs.dotnet-sdk_8
10+
];
11+
12+
# Sets environment variables in the workspace
13+
env = {};
14+
idx = {
15+
# Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
16+
extensions = [
17+
# "muhammad-sammy.csharp"
18+
];
19+
20+
# Enable previews
21+
previews = {
22+
enable = true;
23+
previews = {
24+
web = {
25+
# Example: run "npm run dev" with PORT set to IDX's defined port for previews,
26+
# and show it in IDX's web preview panel
27+
cwd = "./MyApp";
28+
command = [
29+
"dotnet"
30+
"watch"
31+
"--urls=http://localhost:$PORT"
32+
];
33+
manager = "web";
34+
env = {
35+
# Environment variables to set for your server
36+
PORT = "$PORT";
37+
};
38+
};
39+
};
40+
};
41+
42+
# Workspace lifecycle hooks
43+
workspace = {
44+
# Runs when a workspace is first created
45+
onCreate = {
46+
# Example: install JS dependencies from NPM
47+
cwd = "./MyApp";
48+
# npm-install = "npm install";
49+
};
50+
# Runs when the workspace is (re)started
51+
onStart = {
52+
# Example: start a background task to watch and re-build backend code
53+
# watch-backend = "npm run watch-backend";
54+
};
55+
};
56+
};
57+
}

0 commit comments

Comments
 (0)