Skip to content

Instantly share code, notes, and snippets.

@wanyutang
Last active October 4, 2024 04:08
Show Gist options
  • Save wanyutang/ba0b21f3090a068595e7695856a9d91b to your computer and use it in GitHub Desktop.
Save wanyutang/ba0b21f3090a068595e7695856a9d91b to your computer and use it in GitHub Desktop.
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
# pkgs.python311
# pkgs.nodejs_20
pkgs.docker
];
env = {};
services.docker.enable = true;
idx = {
extensions = [
"vscodevim.vim"
];
# Enable previews
previews = {
enable = true;
previews = {
# web = {
# command = ["npm" "run" "dev"];
# manager = "web";
# env = {
# PORT = "$PORT";
# };
# };
};
};
workspace = {
onCreate = {
# npm-install = "npm install";
};
onStart = {
# watch-backend = "npm run watch-backend";
};
};
};
}
# To learn more about how to use Nix to configure your environment
# see: https://developers.google.com/idx/guides/customize-idx-env
{ pkgs, ... }: {
# Which nixpkgs channel to use.
channel = "stable-23.11"; # or "unstable"
# Use https://search.nixos.org/packages to find packages
packages = [
# pkgs.go
# pkgs.python311
pkgs.nodejs_20
];
env = {};
idx = {
extensions = [
"vscodevim.vim"
];
# Enable previews
previews = {
enable = true;
previews = {
web = {
command = ["npm" "run" "dev"];
manager = "web";
env = {
PORT = "$PORT";
};
};
};
};
workspace = {
onCreate = {
npm-install = "npm install";
};
onStart = {
# watch-backend = "npm run watch-backend";
};
};
};
}
version: '3'
services:
app:
image: node:18
container_name: node-app
working_dir: /usr/src/app
volumes:
- .:/usr/src/app
ports:
- "3000:3000"
command: sh -c "yarn install && yarn dev"
restart: unless-stopped
environment:
- NODE_ENV=development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment