| 1 | { |
| 2 | lib, |
| 3 | rustPlatform, |
| 4 | pkg-config, |
| 5 | xorg, |
| 6 | freetype, |
| 7 | fontconfig, |
| 8 | gitRev ? "unkown", |
| 9 | }: |
| 10 | rustPlatform.buildRustPackage (finalAttrs: { |
| 11 | pname = "oxwm"; |
| 12 | version = "${lib.substring 0 8 gitRev}"; |
| 13 | |
| 14 | src = ./.; |
| 15 | |
| 16 | cargoLock = { |
| 17 | lockFile = ./Cargo.lock; |
| 18 | }; |
| 19 | |
| 20 | nativeBuildInputs = [ |
| 21 | pkg-config |
| 22 | ]; |
| 23 | |
| 24 | buildInputs = [ |
| 25 | xorg.libX11 |
| 26 | xorg.libXft |
| 27 | xorg.libXrender |
| 28 | freetype |
| 29 | fontconfig |
| 30 | ]; |
| 31 | |
| 32 | postInstall = '' |
| 33 | install resources/oxwm.desktop -Dt $out/share/xsessions |
| 34 | install -Dm644 resources/oxwm.1 -t $out/share/man/man1 |
| 35 | ''; |
| 36 | |
| 37 | passthru.providedSessions = ["oxwm"]; |
| 38 | |
| 39 | meta = with lib; { |
| 40 | description = "A dynamic window manager written in Rust, inspired by dwm"; |
| 41 | homepage = "https://github.com/tonybanters/oxwm"; |
| 42 | license = licenses.gpl3; |
| 43 | platforms = platforms.linux; |
| 44 | mainProgram = "oxwm"; |
| 45 | }; |
| 46 | }) |