Skip to content

add NixOS setup instructions and improve shell.nix#357

Closed
Mansi2007275 wants to merge 1 commit into
AOSSIE-Org:mainfrom
Mansi2007275:feat/nixos-support
Closed

add NixOS setup instructions and improve shell.nix#357
Mansi2007275 wants to merge 1 commit into
AOSSIE-Org:mainfrom
Mansi2007275:feat/nixos-support

Conversation

@Mansi2007275

@Mansi2007275 Mansi2007275 commented Jun 8, 2026

Copy link
Copy Markdown

Closes #338

Changes

README.md

  • Added a dedicated NixOS section with:
    • nix-shell quickstart
    • Wayland ydotoold group setup steps
    • AppImage execution via appimage-run
    • nftables firewall configuration
    • Troubleshooting table for common errors

shell.nix

  • Removed auto-run commands from shellHook (npm i + npm run dist ran on every shell entry, breaking dev workflow)
  • Added ydotool to buildInputs (required for Wayland input simulation)
  • Added missing Electron X11 libs: libxrandr, libxcomposite, libxdamage, libxfixes
  • Replaced hardcoded Rein-1.0.0.AppImage with wildcard Rein-*.AppImage
  • Added helpful echo guidance so new NixOS contributors know what commands to run

Summary by CodeRabbit

  • Documentation

    • Expanded development setup guidance with comprehensive NixOS workflow including Wayland configuration and troubleshooting.
    • Added MacOS accessibility permissions guidance for terminal and IDE access.
    • Improved Quick Start instructions with enhanced code formatting.
  • Chores

    • Updated development environment configuration with additional X11 runtime libraries and setup instruction messages.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR adds comprehensive NixOS development setup documentation to the README and updates shell.nix with required X11 libraries and ydotool. The shell initialization now prints instructional guidance instead of auto-executing build commands. Additional changes include macOS accessibility permissions notes, layout adjustments, and minor punctuation normalization.

Changes

Development Environment Setup

Layer / File(s) Summary
NixOS environment configuration and documentation
README.md, shell.nix
Expanded README with NixOS dev shell workflow (Wayland/ydotoold setup, AppImage execution, nftables firewall, troubleshooting). Updated shell.nix with X11 libraries (libxrandr, libxcomposite, libxdamage, libxfixes) and ydotool. Changed shellHook from auto-executing npm/appimage commands to printing setup instructions.
Cross-platform developer experience improvements
README.md
Added macOS system accessibility permission instructions for terminal/IDE access. Adjusted README section spacing before "Testing Rein on Virtual Machines" and fixed "Flow summary" table formatting. Normalized punctuation in "Why?" paragraph.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AOSSIE-Org/Rein#251: Both PRs modify shell.nix's dev-shell configuration by extending sharedLibs/buildInputs and adjusting shell behavior.
  • AOSSIE-Org/Rein#252: Both PRs update shell.nix dependencies and library configuration for local development environments.

Suggested labels

Documentation

Poem

🐰 A nixos dev shell blooms so bright,
With ydotool dancing in the night,
X11 libraries now in place,
Shell instructions guide the pace,
macOS welcomes with a gesture's grace!

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides clear details of changes made, though it does not follow the template structure and verification sections are incomplete. Consider aligning the description with the repository template structure and completing the functional verification checklist for consistency.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main changes: adding NixOS setup instructions and improving shell.nix configuration.
Linked Issues check ✅ Passed The changes successfully address issue #338 by adding NixOS-specific setup instructions and improving shell.nix for NixOS functionality.
Out of Scope Changes check ✅ Passed All changes are directly related to the NixOS support objective; README.md and shell.nix modifications are appropriately scoped to issue #338.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4932b6f and a2742c8.

📒 Files selected for processing (2)
  • README.md
  • shell.nix

Comment thread README.md
Comment on lines +30 to +70
### 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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-shell

This 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 ydotoold

Running the built AppImage on NixOS:
+

npm run dist
appimage-run ./dist/Rein-*.AppImage

Firewall (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 -->

Comment thread README.md
Comment on lines +75 to +81
```bash
npm install
```
```
2. Start the development server:
```bash
```bash
npm run dev
```
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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
  1. Start the development server:
    npm run dev
  1. 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 -->

Comment thread README.md
| **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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
| **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

@imxade

imxade commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@Mansi2007275 this needs to wait a bit, for #296

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

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:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@PinJinx PinJinx closed this Jul 14, 2026
@PinJinx PinJinx reopened this Jul 14, 2026
@imxade

imxade commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

closing this for now, you can open a new one as per the recent changes

@imxade imxade closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure functionality on nixos

3 participants