shell.nix 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {pkgs ? import <nixpkgs> {}}:
  2. with pkgs; let
  3. inherit (lib) optional optionals;
  4. inherit (xorg) libX11 libXrandr libXinerama libXcursor libXi libXext;
  5. inherit (darwin.apple_sdk.frameworks) Cocoa CoreGraphics Foundation IOKit Kernel OpenGL UniformTypeIdentifiers;
  6. harfbuzzWithCoreText = harfbuzz.override {withCoreText = stdenv.isDarwin;};
  7. in
  8. with python3Packages;
  9. mkShell rec {
  10. buildInputs =
  11. [
  12. harfbuzzWithCoreText
  13. ncurses
  14. lcms2
  15. xxHash
  16. simde
  17. go_1_23
  18. ]
  19. ++ optionals stdenv.isDarwin [
  20. Cocoa
  21. CoreGraphics
  22. Foundation
  23. IOKit
  24. Kernel
  25. OpenGL
  26. UniformTypeIdentifiers
  27. libpng
  28. python3
  29. zlib
  30. ]
  31. ++ lib.optionals (stdenv.isDarwin && (builtins.hasAttr "UserNotifications" darwin.apple_sdk.frameworks)) [
  32. darwin.apple_sdk.frameworks.UserNotifications
  33. ]
  34. ++ optionals stdenv.isLinux [
  35. fontconfig
  36. libunistring
  37. libcanberra
  38. libX11
  39. libXrandr
  40. libXinerama
  41. libXcursor
  42. libxkbcommon
  43. libXi
  44. libXext
  45. wayland-protocols
  46. wayland
  47. openssl
  48. dbus
  49. ]
  50. ++ checkInputs;
  51. nativeBuildInputs =
  52. [
  53. ncurses
  54. pkg-config
  55. sphinx
  56. furo
  57. sphinx-copybutton
  58. sphinxext-opengraph
  59. sphinx-inline-tabs
  60. ]
  61. ++ optionals stdenv.isDarwin [
  62. imagemagick
  63. libicns # For the png2icns tool.
  64. ];
  65. propagatedBuildInputs = optional stdenv.isLinux libGL;
  66. checkInputs = [
  67. pillow
  68. ];
  69. # Causes build failure due to warning when using Clang
  70. hardeningDisable = ["strictoverflow"];
  71. shellHook =
  72. if stdenv.isDarwin
  73. then ''
  74. export KITTY_NO_LTO=
  75. ''
  76. else ''
  77. export KITTY_EGL_LIBRARY='${lib.getLib libGL}/lib/libEGL.so.1'
  78. export KITTY_STARTUP_NOTIFICATION_LIBRARY='${libstartup_notification}/lib/libstartup-notification-1.so'
  79. export KITTY_CANBERRA_LIBRARY='${libcanberra}/lib/libcanberra.so'
  80. '';
  81. }