ridzimeko revisou este gist . Ir para a revisão
1 file changed, 8 insertions
idx.nix
| @@ -4,6 +4,14 @@ | |||
| 4 | 4 | pkgs.nodejs_22 | |
| 5 | 5 | pkgs.volta | |
| 6 | 6 | ]; | |
| 7 | + | ||
| 8 | + | services = { | |
| 9 | + | postgres = { | |
| 10 | + | enable = true; | |
| 11 | + | package = pkgs.postgresql; | |
| 12 | + | }; | |
| 13 | + | }; | |
| 14 | + | ||
| 7 | 15 | idx.extensions = [ | |
| 8 | 16 | "esbenp.prettier-vscode" | |
| 9 | 17 | "dbaeumer.vscode-eslint" | |
ridzimeko revisou este gist . Ir para a revisão
1 file changed, 18 insertions
idx.nix
| @@ -15,6 +15,24 @@ | |||
| 15 | 15 | "streetsidesoftware.code-spell-checker" | |
| 16 | 16 | "usernamehw.errorlens" | |
| 17 | 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 | + | }; | |
| 18 | 36 | idx.previews = { | |
| 19 | 37 | previews = { | |
| 20 | 38 | web = { | |
ridzimeko revisou este gist . Ir para a revisão
1 file changed, 34 insertions
idx.nix(arquivo criado)
| @@ -0,0 +1,34 @@ | |||
| 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 | + | idx.previews = { | |
| 19 | + | previews = { | |
| 20 | + | web = { | |
| 21 | + | command = [ | |
| 22 | + | "pnpm" | |
| 23 | + | "dev" | |
| 24 | + | "--" | |
| 25 | + | "--port" | |
| 26 | + | "$PORT" | |
| 27 | + | "--hostname" | |
| 28 | + | "0.0.0.0" | |
| 29 | + | ]; | |
| 30 | + | manager = "web"; | |
| 31 | + | }; | |
| 32 | + | }; | |
| 33 | + | }; | |
| 34 | + | } | |