Skip to content

Commit 40847d6

Browse files
docs: Add module creation guide (#71)
Correct and condense dotfiles info and add module creation guide.
1 parent 4776045 commit 40847d6

4 files changed

Lines changed: 370 additions & 36 deletions

File tree

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,7 @@ You can also run `devenv check` to verify that the generated devcontainer.json f
131131
132132
## Configuration
133133
134-
**Project config**: `.devcontainer/devenv.yaml` - Project-specific settings (name, ports, IDE plugins, commands, etc). Checked into version control.
135-
136-
**User config**: `~/.config/devenv/devenv.yaml` - Personal preferences (dotfiles, additional IDE plugins). Merged with project config for the user-specific devcontainer.
137-
138-
Two devcontainer files are generated:
139-
- `.devcontainer/user/devcontainer.json` - Merged config with your personal settings
140-
- `.devcontainer/shared/devcontainer.json` - Project-only config for team use
141-
142-
Your user-specific file is excluded from the Git repository with a .gitignore entry. The general project file can be checked in to provide a project environment for cloud-based editors.
143-
144-
For detailed configuration specifications, see the [Configuration Reference](docs/configuration.md).
134+
For detailed configuration specifications, including all supported fields, modules and the escape hatch, see the [Configuration Reference](docs/configuration.md).
145135
146136
## Development
147137
@@ -169,6 +159,13 @@ The project also includes generation tests that validate the real program output
169159
./generation-tests/run-tests.sh
170160
```
171161

162+
### Contributing
163+
164+
#### Adding a module
165+
166+
See [docs/contributing/adding-a-module.md](docs/contributing/adding-a-module.md)
167+
for a guide on implementing, testing and documenting a new built-in module.
168+
172169
### Release
173170

174171
The project uses a GitHub action to build and publish date-based releases that contain native binaries for macOS arm64 (m-series processors), Linux amd64 and Linux arm64.

core/src/test/resources/userConfig.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ dotfiles:
88
repository: "https://github.com/example/dotfiles.git"
99
targetPath: "~"
1010
installCommand: "install.sh"
11-
containerSize: small
11+
containerSize: small

docs/configuration.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,17 @@ The user config (`~/.config/devenv/devenv.yaml`) supports the following (optiona
7878

7979
### Dotfiles Configuration
8080

81-
The `dotfiles` field in the user config allows you to specify a GitHub repository containing your personal dotfiles to
82-
be cloned and installed into the devcontainer. All three fields are required.
83-
84-
| Field | Description |
85-
|------------------|-------------------------------------------------------------|
86-
| `repository` | GitHub repository (format: `username/repo`) |
87-
| `targetPath` | Path where dotfiles will be cloned in the container |
88-
| `installCommand` | Script to run for installation (executed from `targetPath`) |
81+
The `dotfiles` field allows you to specify a GitHub repository containing your personal dotfiles to be cloned and
82+
installed into the devcontainer. All three fields are required.
83+
The dotfiles setup runs after project/container setup
84+
to avoid interfering with shared configuration. The repository is cloned into the container at the specified path and
85+
the `installCommand` is executed from there.
86+
87+
| Field | Description |
88+
|------------------|-------------------------------------------------------------------------|
89+
| `repository` | Full GitHub repository URL (eg. `https://github.com/username/dotfiles`) |
90+
| `targetPath` | Path where dotfiles will be cloned in the container |
91+
| `installCommand` | Script to run for installation (executed from `targetPath`) |
8992

9093
### Example
9194

@@ -95,9 +98,9 @@ plugins:
9598
- usernamehw.errorlens
9699
- eamodio.gitlens
97100
dotfiles:
98-
repository: "your-github-id/your-dotfiles-repo"
101+
repository: "https://github.com/username/dotfiles"
99102
targetPath: "~/dotfiles"
100-
installCommand: "install.sh"
103+
installCommand: "./install.sh"
101104
```
102105

103106
## Escape Hatch Spec
@@ -167,20 +170,10 @@ modules:
167170
- docker-in-docker # Now enabled
168171
```
169172

170-
## Dotfiles
171-
172-
You can configure personal dotfiles in your user config (`~/.config/devenv/devenv.yaml`) to automatically clone and
173-
install them during container creation:
174-
175-
```yaml
176-
dotfiles:
177-
repository: "your-github-id/your-dotfiles-repo"
178-
targetPath: "~/dotfiles"
179-
installCommand: "install.sh"
180-
```
173+
### Adding a new module
181174

182-
The dotfiles setup runs after project/container setup to avoid interfering with shared configuration. The repository is
183-
cloned into the container at the specified path, and the `installCommand` is executed from there.
175+
See the [Adding a Module](contributing/adding-a-module.md) guide for a full walkthrough of how to
176+
implement, test and document a new built-in module.
184177

185178
## Container Size
186179

@@ -209,4 +202,4 @@ container (although we keep the shared memory):
209202
|-----------------|-------------------------|
210203
| --memory=1g | 1Gb of memory |
211204
| --cpus=1 | One core |
212-
| --shm-size=512m | 512Mb of shared memory* |
205+
| --shm-size=512m | 512Mb of shared memory* |

0 commit comments

Comments
 (0)