Last active 1755787406

Revision 019a30f121a03eb90310e12af505e0ff34888cf7

idx.nix Raw
1{pkgs}: {
2 channel = "stable-24.05";
3 packages = [
4 pkgs.nodejs_22
5 pkgs.volta
6 ];
7 idx.extensions = [
8 "esbenp.prettier-vscode"
9 "dbaeumer.vscode-eslint"
10 "bradlc.vscode-tailwindcss"
11 "dsznajder.es7-react-js-snippets"
12 "DavidAnson.vscode-markdownlint"
13 "EditorConfig.EditorConfig"
14 "mikestead.dotenv"
15 "streetsidesoftware.code-spell-checker"
16 "usernamehw.errorlens"
17 ];
18 workspace = {
19 # Runs when a workspace is first created with this `dev.nix` file
20 onCreate = {
21 npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing";
22 # Open editors for the following files by default, if they exist:
23 # default.openFiles = [ "src/App.tsx" "src/App.ts" "src/App.jsx" "src/App.js" ];
24
25 # if db not created use this command
26 # initdb -D local
27 setup-postgres = ''
28 psql --dbname=postgres -c "ALTER USER \"user\" PASSWORD 'mypassword';"
29 psql --dbname=postgres -c "CREATE DATABASE youtube;"
30 psql --dbname=youtube -f create.sql
31 psql --dbname=youtube -f example.sql
32 '';
33 };
34 # To run something each time the workspace is (re)started, use the `onStart` hook
35 };
36 idx.previews = {
37 previews = {
38 web = {
39 command = [
40 "pnpm"
41 "dev"
42 "--"
43 "--port"
44 "$PORT"
45 "--hostname"
46 "0.0.0.0"
47 ];
48 manager = "web";
49 };
50 };
51 };
52}