idx.nix
· 1.4 KiB · Nix
Исходник
{pkgs}: {
channel = "stable-24.05";
packages = [
pkgs.nodejs_22
pkgs.volta
];
idx.extensions = [
"esbenp.prettier-vscode"
"dbaeumer.vscode-eslint"
"bradlc.vscode-tailwindcss"
"dsznajder.es7-react-js-snippets"
"DavidAnson.vscode-markdownlint"
"EditorConfig.EditorConfig"
"mikestead.dotenv"
"streetsidesoftware.code-spell-checker"
"usernamehw.errorlens"
];
workspace = {
# Runs when a workspace is first created with this `dev.nix` file
onCreate = {
npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing";
# Open editors for the following files by default, if they exist:
# default.openFiles = [ "src/App.tsx" "src/App.ts" "src/App.jsx" "src/App.js" ];
# if db not created use this command
# initdb -D local
setup-postgres = ''
psql --dbname=postgres -c "ALTER USER \"user\" PASSWORD 'mypassword';"
psql --dbname=postgres -c "CREATE DATABASE youtube;"
psql --dbname=youtube -f create.sql
psql --dbname=youtube -f example.sql
'';
};
# To run something each time the workspace is (re)started, use the `onStart` hook
};
idx.previews = {
previews = {
web = {
command = [
"pnpm"
"dev"
"--"
"--port"
"$PORT"
"--hostname"
"0.0.0.0"
];
manager = "web";
};
};
};
}
| 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 | } |