add NixOS setup instructions and improve shell.nix#357
Conversation
WalkthroughThis PR adds comprehensive NixOS development setup documentation to the README and updates ChangesDevelopment Environment Setup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Line 240: The README.md file is missing a trailing newline; open the file and
ensure it ends with a single newline character (add one blank line/line break at
EOF) so the final line containing the description of Input injection (mentioning
DataChannel bridge, InputHandler, virtual input device) terminates with a
POSIX-compliant newline.
- Around line 30-70: The fenced code blocks in the NixOS section (the three
```bash blocks that wrap the nix-shell command, the Wayland input setup
commands, the AppImage run commands, and the ```nix block for
networking.firewall.allowedTCPPorts) need a blank line before and after each
fence to satisfy MD031; edit the README.md NixOS section to insert an empty line
immediately above and below each ```bash and ```nix fenced block so Markdown
renders correctly and linting passes.
- Around line 75-81: Quick Start's fenced bash code blocks lack surrounding
blank lines, triggering MD031; edit the README.md Quick Start section to add a
blank line before and after each ```bash code block (the two occurrences of
```bash around "npm install" and "npm run dev"), and ensure there's a blank line
after the closing fences and before the next numbered step (also add a blank
line before the "Open the local app" line if present) so each fenced block is
separated from adjacent text.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d48e0e1d-5cdb-49a8-9929-a8daeac6c284
📒 Files selected for processing (2)
README.mdshell.nix
| ### NixOS | ||
|
|
||
| Rein provides a `shell.nix` for a fully reproducible NixOS development environment. | ||
|
|
||
| **Enter the dev shell:** | ||
| ```bash | ||
| nix-shell | ||
| ``` | ||
|
|
||
| This sets up all required native libraries and makes `ydotool`, `appimage-run`, and `nodejs_24` available automatically. | ||
|
|
||
| **Wayland input setup (one time only):** | ||
| ```bash | ||
| # Add your user to the ydotool group | ||
| sudo usermod -aG ydotool $USER | ||
|
|
||
| # Re-login, then enable the daemon | ||
| sudo systemctl enable --now ydotoold | ||
| ``` | ||
|
|
||
| **Running the built AppImage on NixOS:** | ||
| ```bash | ||
| npm run dist | ||
| appimage-run ./dist/Rein-*.AppImage | ||
| ``` | ||
|
|
||
| **Firewall (nftables):** | ||
|
|
||
| Add to your `configuration.nix`, then run `sudo nixos-rebuild switch`: | ||
| ```nix | ||
| networking.firewall.allowedTCPPorts = [ 3000 ]; | ||
| ``` | ||
|
|
||
| **Troubleshooting:** | ||
|
|
||
| | Error | Fix | | ||
| |-------|-----| | ||
| | `Failed to open /dev/uinput` | Run `sudo systemctl start ydotoold` | | ||
| | `error while loading shared libraries: libX11.so` | Make sure you are inside `nix-shell` | | ||
| | Electron crashes on launch | `LD_LIBRARY_PATH` must be set — the `shellHook` does this automatically | | ||
| | AppImage won't start | Use `appimage-run ./dist/Rein-*.AppImage`, not `./dist/Rein-*.AppImage` directly | |
There was a problem hiding this comment.
Add blank lines around fenced code blocks for markdown compliance.
Several fenced code blocks in the NixOS section are missing blank lines before or after them, which violates markdown formatting best practices (MD031). This affects readability and consistency.
📝 Proposed fix to add blank lines
**Enter the dev shell:**
+
```bash
nix-shellThis sets up all required native libraries and makes ydotool, appimage-run, and nodejs_24 available automatically.
Wayland input setup (one time only):
+
# Add your user to the ydotool group
sudo usermod -aG ydotool $USER
# Re-login, then enable the daemon
sudo systemctl enable --now ydotooldRunning the built AppImage on NixOS:
+
npm run dist
appimage-run ./dist/Rein-*.AppImageFirewall (nftables):
Add to your configuration.nix, then run sudo nixos-rebuild switch:
+
networking.firewall.allowedTCPPorts = [ 3000 ];</details>
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>
[warning] 35-35: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 42-42: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 51-51: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 59-59: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @README.md around lines 30 - 70, The fenced code blocks in the NixOS section
(the three bash blocks that wrap the nix-shell command, the Wayland input setup commands, the AppImage run commands, and the nix block for
networking.firewall.allowedTCPPorts) need a blank line before and after each
fence to satisfy MD031; edit the README.md NixOS section to insert an empty line
immediately above and below each bash and nix fenced block so Markdown
renders correctly and linting passes.
</details>
<!-- fingerprinting:phantom:poseidon:puma -->
<!-- cr-comment:v1:cb1bda0fdc8eef576d4a8720 -->
_Source: Linters/SAST tools_
<!-- This is an auto-generated comment by CodeRabbit -->
| ```bash | ||
| npm install | ||
| ``` | ||
| ``` | ||
| 2. Start the development server: | ||
| ```bash | ||
| ```bash | ||
| npm run dev | ||
| ``` | ||
| ``` |
There was a problem hiding this comment.
Add blank lines around fenced code blocks in Quick Start.
The bash code blocks are missing surrounding blank lines, causing markdown formatting violations (MD031).
📝 Proposed fix
1. Install dependencies:
+
```bash
npm install- Start the development server:
npm run dev- Open the local app:
http://localhost:3000
</details>
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>
[warning] 75-75: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 77-77: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 78-78: Ordered list item prefix
Expected: 1; Actual: 2; Style: 1/1/1
(MD029, ol-prefix)
---
[warning] 79-79: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 81-81: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @README.md around lines 75 - 81, Quick Start's fenced bash code blocks lack
surrounding blank lines, triggering MD031; edit the README.md Quick Start
section to add a blank line before and after each bash code block (the two occurrences of bash around "npm install" and "npm run dev"), and ensure
there's a blank line after the closing fences and before the next numbered step
(also add a blank line before the "Open the local app" line if present) so each
fenced block is separated from adjacent text.
</details>
<!-- fingerprinting:phantom:poseidon:puma -->
<!-- cr-comment:v1:0dee14dfc288159491979e54 -->
_Source: Linters/SAST tools_
<!-- This is an auto-generated comment by CodeRabbit -->
| | **Input injection** | Input events arrive at the server via the DataChannel bridge, dispatched through `InputHandler` (throttle + validation), and injected at OS level via a virtual input device. | | ||
|
|
||
|
|
||
| | **Input injection** | Input events arrive at the server via the DataChannel bridge, dispatched through `InputHandler` (throttle + validation), and injected at OS level via a virtual input device. | No newline at end of file |
There was a problem hiding this comment.
Add trailing newline at end of file.
Markdown files should end with a single newline character (MD047) for POSIX text file compliance and cleaner git diffs.
📝 Proposed fix
| **Input injection** | Input events arrive at the server via the DataChannel bridge, dispatched through `InputHandler` (throttle + validation), and injected at OS level via a virtual input device. |
+📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | **Input injection** | Input events arrive at the server via the DataChannel bridge, dispatched through `InputHandler` (throttle + validation), and injected at OS level via a virtual input device. | | |
| | **Input injection** | Input events arrive at the server via the DataChannel bridge, dispatched through `InputHandler` (throttle + validation), and injected at OS level via a virtual input device. | | |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 240-240: Files should end with a single newline character
(MD047, single-trailing-newline)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` at line 240, The README.md file is missing a trailing newline;
open the file and ensure it ends with a single newline character (add one blank
line/line break at EOF) so the final line containing the description of Input
injection (mentioning DataChannel bridge, InputHandler, virtual input device)
terminates with a POSIX-compliant newline.
Source: Linters/SAST tools
|
@Mansi2007275 this needs to wait a bit, for #296 |
|
Please resolve the merge conflicts before review. Your PR will only be reviewed by a maintainer after all conflicts have been resolved. 📺 Watch this video to understand why conflicts occur and how to resolve them: |
|
closing this for now, you can open a new one as per the recent changes |
Closes #338
Changes
README.md
shell.nix
Summary by CodeRabbit
Documentation
Chores