commit e5ab764deb4253136fe0f92a4e91a30611432882 Author: Martin Potier Date: Tue Feb 20 13:20:44 2018 +0200 Initial commit diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..70e8c83 --- /dev/null +++ b/default.nix @@ -0,0 +1,3 @@ +{ + nixpkgs.overlays = [ (import ./pkgs) ]; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..f59c8f8 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,22 @@ +# This overlay provides a set of stable ressources to make bravo-vpn work +# reliably. + +self: super: + +{ + qutebrowserWE = super.qutebrowser.override { withWebEngineDefault = true; }; + kitty = super.callPackage ./kitty {}; + iosevka-hskl = let + tags = [ + "ss08" # Use Pragmata Pro Style + "term" # Disable ligature/ligation + ]; + in + super.iosevka.override { + nodejs = super.nodejs-8_x; + design = tags; + set = "PPStyle"; + }; + +} + diff --git a/pkgs/kitty/default.nix b/pkgs/kitty/default.nix new file mode 100755 index 0000000..ad074de --- /dev/null +++ b/pkgs/kitty/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchFromGitHub, pkgs, python3Packages, glfw, libunistring, harfbuzz, fontconfig, zlib, pkgconfig, ncurses, imagemagick, makeWrapper, xsel, libstartup_notification, libX11, libXrandr, libXinerama, libXcursor, libxkbcommon, libXi, libXext }: + +with python3Packages; +buildPythonApplication rec { + version = "0.7.0"; + name = "kitty-${version}"; + format = "other"; + + src = fetchFromGitHub { + owner = "kovidgoyal"; + repo = "kitty"; + rev = "v${version}"; + sha256 = "0x92w30caym042bmln6nw6f3v764sg06c2kb9hrwpmh6nhlxcs90"; + }; + + buildInputs = [ fontconfig glfw ncurses libunistring harfbuzz libX11 libXrandr libXinerama libXcursor libxkbcommon libXi libXext ]; + + nativeBuildInputs = [ pkgconfig ]; + + postPatch = '' + substituteInPlace kitty/utils.py \ + --replace "find_library('startup-notification-1')" "'${libstartup_notification}/lib/libstartup-notification-1.so'" + ''; + + buildPhase = '' + python3 setup.py linux-package + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out + cp -r linux-package/{bin,share,lib} $out + wrapProgram "$out/bin/kitty" --prefix PATH : "$out/bin:${stdenv.lib.makeBinPath [ imagemagick xsel ]}" + runHook postInstall + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/kovidgoyal/kitty; + description = "A modern, hackable, featureful, OpenGL based terminal emulator"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ tex ]; + }; +} + diff --git a/pkgs/kitty/harfbuzz.nix b/pkgs/kitty/harfbuzz.nix new file mode 100755 index 0000000..f5756d1 --- /dev/null +++ b/pkgs/kitty/harfbuzz.nix @@ -0,0 +1,56 @@ +{ stdenv, fetchurl, pkgconfig, glib, freetype, cairo, libintlOrEmpty +, icu, graphite2, harfbuzz # The icu variant uses and propagates the non-icu one. +, withIcu ? false # recommended by upstream as default, but most don't needed and it's big +, withGraphite2 ? true # it is small and major distros do include it +}: + +let + version = "1.5.1"; + inherit (stdenv.lib) optional optionals optionalString; +in + +stdenv.mkDerivation { + name = "harfbuzz${optionalString withIcu "-icu"}-${version}"; + + src = fetchurl { + url = "http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2"; + sha256 = "56838dfdad2729b8866763c82d623354d138a4d99d9ffb710c7d377b5cfc7c51"; + }; + + outputs = [ "out" "dev" ]; + outputBin = "dev"; + + configureFlags = [ + ( "--with-graphite2=" + (if withGraphite2 then "yes" else "no") ) # not auto-detected by default + ( "--with-icu=" + (if withIcu then "yes" else "no") ) + ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ glib freetype cairo ] # recommended by upstream + ++ libintlOrEmpty; + propagatedBuildInputs = [] + ++ optional withGraphite2 graphite2 + ++ optionals withIcu [ icu harfbuzz ] + ; + + # Slightly hacky; some pkgs expect them in a single directory. + postInstall = optionalString withIcu '' + rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc" + ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la + ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc + ${optionalString stdenv.isDarwin '' + ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib + ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib + ''} + ''; + + meta = with stdenv.lib; { + description = "An OpenType text shaping engine"; + homepage = http://www.freedesktop.org/wiki/Software/HarfBuzz; + downloadPage = "https://www.freedesktop.org/software/harfbuzz/release/"; + maintainers = [ maintainers.eelco ]; + platforms = with platforms; linux ++ darwin; + inherit version; + updateWalker = true; + }; +}