From 348ae8f6ec7172809196cf892b4f8b0d531bd610 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Tue, 17 May 2016 01:50:43 +0200 Subject: [PATCH] termite: make it possible to provide a configuration file for termite also added myself as a maintainer --- pkgs/applications/misc/termite/default.nix | 69 +++++++++++++--------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/pkgs/applications/misc/termite/default.nix b/pkgs/applications/misc/termite/default.nix index 683e5db2d13e..afedef45af8f 100644 --- a/pkgs/applications/misc/termite/default.nix +++ b/pkgs/applications/misc/termite/default.nix @@ -1,34 +1,47 @@ -{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses }: +{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses, makeWrapper +, configFile ? null +}: -stdenv.mkDerivation rec { - name = "termite-${version}"; +let version = "11"; + termite = stdenv.mkDerivation { + name = "termite-${version}"; - src = fetchgit { - url = "https://github.com/thestinger/termite"; - rev = "refs/tags/v${version}"; - sha256 = "1k91nw19c0p5ghqhs00mn9npa91idfkyiwik3ng6hb4jbnblp5ph"; + src = fetchgit { + url = "https://github.com/thestinger/termite"; + rev = "refs/tags/v${version}"; + sha256 = "1k91nw19c0p5ghqhs00mn9npa91idfkyiwik3ng6hb4jbnblp5ph"; + }; + + makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; + + buildInputs = [ pkgconfig vte gtk3 ncurses ]; + + outputs = [ "out" "terminfo" ]; + + postInstall = '' + mkdir -p $terminfo/share + mv $out/share/terminfo $terminfo/share/terminfo + + mkdir -p $out/nix-support + echo "$terminfo" >> $out/nix-support/propagated-user-env-packages + ''; + + meta = with stdenv.lib; { + description = "A simple VTE-based terminal"; + license = licenses.lgpl2Plus; + homepage = https://github.com/thestinger/termite/; + maintainers = with matinainers; [ koral garbas ]; + platforms = platforms.all; + }; }; - - makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; - - buildInputs = [ pkgconfig vte gtk3 ncurses ]; - - outputs = [ "out" "terminfo" ]; - - postInstall = '' - mkdir -p $terminfo/share - mv $out/share/terminfo $terminfo/share/terminfo - - mkdir -p $out/nix-support - echo "$terminfo" >> $out/nix-support/propagated-user-env-packages +in if configFile == null then termite else stdenv.mkDerivation { + name = "termite-with-config-${version}"; + nativeBuildInputs = [ makeWrapper ]; + buildCommand = '' + mkdir -p $out/etc/xdg/termite/ $out/bin + ln -s ${termite}/bin/termite $out/bin/termite + wrapProgram $out/bin/termite --add-flags "--config ${configFile}" ''; - - meta = with stdenv.lib; { - description = "A simple VTE-based terminal"; - license = licenses.lgpl2Plus; - homepage = https://github.com/thestinger/termite/; - maintainers = [ maintainers.koral ]; - platforms = platforms.all; - }; + passthru.terminfo = termite.terminfo; }