File: shell.nix

package info (click to toggle)
kitty 0.42.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 28,564 kB
  • sloc: ansic: 82,787; python: 55,191; objc: 5,122; sh: 1,295; xml: 364; makefile: 143; javascript: 78
file content (101 lines) | stat: -rw-r--r-- 2,927 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{pkgs ? import <nixpkgs> {}}:
with pkgs; let
  inherit (lib) optional optionals;
  inherit (xorg) libX11 libXrandr libXinerama libXcursor libXi libXext;
  inherit (darwin.apple_sdk.frameworks) Cocoa CoreGraphics Foundation IOKit Kernel OpenGL UniformTypeIdentifiers;
  harfbuzzWithCoreText = harfbuzz.override {withCoreText = stdenv.isDarwin;};
in
  with python3Packages;
    mkShell rec {
      buildInputs =
        [
          harfbuzzWithCoreText
          ncurses
          lcms2
          xxHash
          simde
          go_1_23
          matplotlib
        ]
        ++ optionals stdenv.isDarwin [
          Cocoa
          CoreGraphics
          Foundation
          IOKit
          Kernel
          OpenGL
          UniformTypeIdentifiers
          libpng
          zlib
        ]
        ++ lib.optionals (stdenv.isDarwin && (builtins.hasAttr "UserNotifications" darwin.apple_sdk.frameworks)) [
          darwin.apple_sdk.frameworks.UserNotifications
        ]
        ++ optionals stdenv.isLinux [
          fontconfig
          libunistring
          libcanberra
          libX11
          libXrandr
          libXinerama
          libXcursor
          libxkbcommon
          libXi
          libXext
          wayland-protocols
          wayland
          openssl
          dbus
          cairo #
        ]
        ++ lib.optionals stdenv.hostPlatform.isLinux [
          wayland-scanner
        ]
        ++ checkInputs;

      nativeBuildInputs =
        [
          ncurses
          pkg-config
          sphinx
          furo
          sphinx-copybutton
          sphinxext-opengraph
          sphinx-inline-tabs
        ]
        ++ optionals stdenv.isDarwin [
          imagemagick
          libicns # For the png2icns tool.
        ];

      propagatedBuildInputs = optional stdenv.isLinux libGL;

      checkInputs = [
        pillow
      ];

      # Causes build failure due to warning when using Clang
      hardeningDisable = ["strictoverflow"];

      shellHook =
        if stdenv.isDarwin
        then ''
          export KITTY_NO_LTO=
          # Add fonts by hand

          if [ ! -e ./fonts/SymbolsNerdFontMono-Regular.ttf ]; then
            cp "${nerd-fonts.symbols-only}/share/fonts/truetype/NerdFonts/Symbols/SymbolsNerdFontMono-Regular.ttf" ./fonts/
          fi
        ''
        else ''
          export KITTY_EGL_LIBRARY='${lib.getLib libGL}/lib/libEGL.so.1'
          export KITTY_STARTUP_NOTIFICATION_LIBRARY='${libstartup_notification}/lib/libstartup-notification-1.so'
          export KITTY_CANBERRA_LIBRARY='${libcanberra}/lib/libcanberra.so'
          export KITTY_FONTCONFIG_LIBRARY='${fontconfig.lib}/lib/libfontconfig.so'

          # Add fonts by hand
          if [ ! -e ./fonts/SymbolsNerdFontMono-Regular.ttf ]; then
            cp "${nerd-fonts.symbols-only}/share/fonts/truetype/NerdFonts/Symbols/SymbolsNerdFontMono-Regular.ttf" ./fonts/
          fi
        '';
    }