-
-
Notifications
You must be signed in to change notification settings - Fork 77
add NixOS setup instructions and improve shell.nix #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ A cross-platform, remote desktop (started as a couch keyboard replacement utiliz | |||||||
|
|
||||||||
| ## Why? | ||||||||
|
|
||||||||
| Quality couch keyboards are not so accessible, STT on Linux isn’t in a good state, so we can take advantage of STT on mobile, plus use the phone as a controller for casual gaming. | ||||||||
| Quality couch keyboards are not so accessible, STT on Linux isn't in a good state, so we can take advantage of STT on mobile, plus use the phone as a controller for casual gaming. | ||||||||
|
|
||||||||
| ## Tech Stack | ||||||||
|
|
||||||||
|
|
@@ -27,17 +27,58 @@ Quality couch keyboards are not so accessible, STT on Linux isn’t in a good st | |||||||
| > [!NOTE] | ||||||||
| > **For Linux:** On Wayland, the `ydotoold` daemon must be running and your user must be part of the `ydotool` group. Additionally, some native dependencies are required : install them via your package manager (see [`shell.nix`](shell.nix) for the list), or use `nix-shell` directly. | ||||||||
|
|
||||||||
| ### 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 | | ||||||||
|
|
||||||||
| ### Quick Start | ||||||||
|
|
||||||||
| 1. Install dependencies: | ||||||||
| ```bash | ||||||||
| ```bash | ||||||||
| npm install | ||||||||
| ``` | ||||||||
| ``` | ||||||||
| 2. Start the development server: | ||||||||
| ```bash | ||||||||
| ```bash | ||||||||
| npm run dev | ||||||||
| ``` | ||||||||
| ``` | ||||||||
|
Comment on lines
+75
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
npm run dev
Verify each finding against current code. Fix only still-valid issues, skip the In |
||||||||
| 3. Open the local app: `http://localhost:3000` | ||||||||
|
|
||||||||
| ## How to Use (Remote Control) | ||||||||
|
|
@@ -69,7 +110,6 @@ Visit the [Discord Channel](https://discord.com/invite/C8wHmwtczs) for interacti | |||||||
|
|
||||||||
| --- | ||||||||
|
|
||||||||
|
|
||||||||
| ## Testing Rein on Virtual Machines | ||||||||
|
|
||||||||
| When testing Rein inside a Virtual Machine (VirtualBox), the VM must allow devices on the same network to access the server. | ||||||||
|
|
@@ -87,7 +127,6 @@ This allows devices on the same LAN to connect to the Rein server running inside | |||||||
|
|
||||||||
| Grant Accessibility permission to your terminal/IDE in System Settings → Privacy & Security → Accessibility. | ||||||||
|
|
||||||||
|
|
||||||||
| --- | ||||||||
|
|
||||||||
| ## Expected Architecture | ||||||||
|
|
@@ -198,6 +237,4 @@ flowchart TD | |||||||
| | **Screen mirroring** | `getDisplayMedia()` feeds a MediaTrack directly into the `RTCPeerConnection`. The phone renders it in a `<video>` element. The server never handles video frames. | | ||||||||
| | **Client settings** | Sensitivity, scroll invert, and theme are stored in `localStorage` on the phone only — no server round-trip. | | ||||||||
| | **Server settings** | Port changes call `POST /api/config`, which writes `server-config.json`. The client redirects to the new port URL. The change is picked up on the next server start. | | ||||||||
| | **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. | | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.22.1)[warning] 240-240: Files should end with a single newline character (MD047, single-trailing-newline) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, andnodejs_24available automatically.Wayland input setup (one time only):
+
Running the built AppImage on NixOS:
+
npm run dist appimage-run ./dist/Rein-*.AppImageFirewall (nftables):
Add to your
configuration.nix, then runsudo nixos-rebuild switch:+
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.mdaround 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 thenix block fornetworking.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 andnix fenced block so Markdownrenders correctly and linting passes.