File tree Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Expand file tree Collapse file tree 4 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ result
Original file line number Diff line number Diff line change 1+ {
2+ description = "Tablet mode detection and setup scripts for linux" ;
3+
4+ inputs = {
5+ nixpkgs . url = "github:nixos/nixpkgs/nixos-unstable" ;
6+ } ;
7+
8+ outputs = { self , nixpkgs } : {
9+
10+ packages . x86_64-linux . linux_detect_tablet_mode = nixpkgs . legacyPackages . "x86_64-linux" . callPackage ./package.nix { } ;
11+
12+ packages . x86_64-linux . default = self . packages . x86_64-linux . linux_detect_tablet_mode ;
13+
14+ } ;
15+ }
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ stdenv ,
4+ libinput ,
5+ ruby ,
6+ makeWrapper # 提供wrapProgram工具
7+ } :
8+ stdenv . mkDerivation rec {
9+ pname = "linux_detect_tablet_mode" ;
10+ version = "unstable" ;
11+
12+ src = ./. ;
13+
14+ # 依赖:libinput(提供命令)和makeWrapper(提供wrapProgram)
15+ buildInputs = [ libinput ruby ] ;
16+ nativeBuildInputs = [ makeWrapper ] ; # 构建时需要makeWrapper
17+
18+ installPhase = ''
19+ mkdir -p $out/bin
20+ cp "$src/watch_tablet" "$out/bin/"
21+ chmod +x "$out/bin/watch_tablet"
22+
23+ wrapProgram "$out/bin/watch_tablet" \
24+ --prefix PATH : "${ libinput } /bin" \
25+ --prefix PATH : "${ ruby } /bin"
26+ '' ;
27+
28+ meta = with lib ; {
29+ description = "Tablet mode detection and setup scripts for linux" ;
30+ license = licenses . mit ;
31+ mainProgram = "watch_tablet" ;
32+ } ;
33+ }
34+
You can’t perform that action at this time.
0 commit comments