add nix dev shell and setup notes
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
# Development setup
|
||||
|
||||
## Enter shell
|
||||
|
||||
```bash
|
||||
nix develop
|
||||
```
|
||||
|
||||
This shell includes:
|
||||
|
||||
- Rust: `cargo`, `rustc`, `rustfmt`, `clippy`, `rust-analyzer`
|
||||
- Build tools: `pkg-config`, `gcc`, `clang`, `make`, `git`
|
||||
- Input debug: `evtest`, `libinput`, `wev`
|
||||
- CLI tools: `jq`, `rg`, `fd`, `jj`
|
||||
|
||||
## Recommended NixOS runtime config (uinput)
|
||||
|
||||
For `gotta-scroll-fast` (`gsfd`), you typically need `/dev/uinput`.
|
||||
|
||||
```nix
|
||||
{
|
||||
boot.kernelModules = [ "uinput" ];
|
||||
|
||||
# Optional: ensure module is available in initrd/system profile
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="input"
|
||||
'';
|
||||
|
||||
users.users.<your-user>.extraGroups = [ "input" ];
|
||||
}
|
||||
```
|
||||
|
||||
Then rebuild and re-login.
|
||||
|
||||
## Useful checks
|
||||
|
||||
```bash
|
||||
ls -l /dev/uinput
|
||||
id
|
||||
sudo evtest
|
||||
libinput debug-events
|
||||
wev
|
||||
```
|
||||
|
||||
## First run (project)
|
||||
|
||||
```bash
|
||||
cargo run -p gsf-daemon -- --list-devices
|
||||
cargo run -p gsf-cli -- tui
|
||||
```
|
||||
Generated
+61
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1774106199,
|
||||
"narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
description = "gotta-scroll-fast (gsf) - host-side scroll acceleration toolkit";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
let
|
||||
eachSystem = flake-utils.lib.eachDefaultSystem;
|
||||
in
|
||||
eachSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = false;
|
||||
};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
rustc
|
||||
cargo
|
||||
rustfmt
|
||||
clippy
|
||||
rust-analyzer
|
||||
rustPlatform.rustLibSrc
|
||||
|
||||
pkg-config
|
||||
gcc
|
||||
clang
|
||||
gnumake
|
||||
git
|
||||
|
||||
evtest
|
||||
libinput
|
||||
wev
|
||||
|
||||
jq
|
||||
ripgrep
|
||||
fd
|
||||
jj
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export RUST_SRC_PATH="${pkgs.rustPlatform.rustLibSrc}"
|
||||
|
||||
echo
|
||||
echo "✅ gsf dev shell ready"
|
||||
echo " Rust: $(rustc --version)"
|
||||
echo " Cargo: $(cargo --version)"
|
||||
echo " JJ: $(jj --version | head -n1)"
|
||||
echo
|
||||
if [ -e /dev/uinput ]; then
|
||||
echo "uinput: present at /dev/uinput"
|
||||
ls -l /dev/uinput
|
||||
else
|
||||
echo "uinput: /dev/uinput not found"
|
||||
echo " enable with: boot.kernelModules = [ \"uinput\" ];"
|
||||
fi
|
||||
echo
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user