diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix index 7ec32fe83b54..628d475c9684 100644 --- a/nixos/modules/services/x11/window-managers/default.nix +++ b/nixos/modules/services/x11/window-managers/default.nix @@ -14,6 +14,7 @@ in ./i3.nix ./metacity.nix ./openbox.nix + ./sawfish.nix ./stumpwm.nix ./twm.nix ./windowmaker.nix diff --git a/nixos/modules/services/x11/window-managers/sawfish.nix b/nixos/modules/services/x11/window-managers/sawfish.nix new file mode 100644 index 000000000000..74a119260208 --- /dev/null +++ b/nixos/modules/services/x11/window-managers/sawfish.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.xserver.windowManager.sawfish; +in +{ + ###### interface + options = { + services.xserver.windowManager.sawfish.enable = mkOption { + default = false; + description = "Enable the Sawfish window manager."; + }; + }; + + ###### implementation + config = mkIf cfg.enable { + services.xserver.windowManager.session = singleton { + name = "sawfish"; + start = '' + ${pkgs.sawfish}/bin/sawfish & + waitPID=$! + ''; + }; + environment.systemPackages = [ pkgs.sawfish ]; + }; +} diff --git a/pkgs/applications/window-managers/sawfish/default.nix b/pkgs/applications/window-managers/sawfish/default.nix new file mode 100644 index 000000000000..4281eb99dd03 --- /dev/null +++ b/pkgs/applications/window-managers/sawfish/default.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchgit, pkgconfig, which, autoreconfHook, rep-gtk, pango, gdk_pixbuf, libXinerama, libXrandr, libXtst, imlib, gettext, texinfo, makeWrapper }: + +with stdenv.lib; +stdenv.mkDerivation rec { + + name = "sawfish-git-2015-02-15"; + + src = fetchgit { + url = "https://github.com/SawfishWM/sawfish.git"; + rev = "44729f44017e6779b4b66a7ecdbd63a98731f668"; + sha256 = "bd3f42f1604f37ecb2515008341cac4f6965840b2d6a6639dd1f3f2459f68e73"; + }; + + buildInputs = [ pkgconfig which autoreconfHook rep-gtk pango gdk_pixbuf libXinerama libXrandr libXtst imlib gettext texinfo makeWrapper ]; + + patchPhase = '' + sed -e 's|REP_DL_LOAD_PATH=|REP_DL_LOAD_PATH=$(REP_DL_LOAD_PATH):|g' -i Makedefs.in + sed -e 's|$(repexecdir)|$(libdir)/rep|g' -i src/Makefile.in + ''; + + postInstall = '' + for i in $out/lib/sawfish/sawfish-menu $out/bin/sawfish-about $out/bin/sawfish-client $out/bin/sawfish-config $out/bin/sawfish; do + wrapProgram $i \ + --prefix REP_DL_LOAD_PATH "$out/lib/rep" \ + --set REP_LOAD_PATH "$out/share/sawfish/lisp" + done + ''; + + meta = { + description = "An extensible, Lisp-based window manager"; + longDescription = '' + Sawfish is an extensible window manager using a Lisp-based scripting language. + Its policy is very minimal compared to most window managers. Its aim is simply + to manage windows in the most flexible and attractive manner possible. + All high-level WM functions are implemented in Lisp for future extensibility + or redefinition. + ''; + homepage = http://sawfish.wikia.com; + license = licenses.gpl2; + maintainers = [ maintainers.AndersonTorres ]; + }; +} diff --git a/pkgs/development/libraries/librep/default.nix b/pkgs/development/libraries/librep/default.nix new file mode 100644 index 000000000000..2abe01decb77 --- /dev/null +++ b/pkgs/development/libraries/librep/default.nix @@ -0,0 +1,42 @@ + + { stdenv, fetchgit +, pkgconfig, autoreconfHook +, readline, texinfo +, gdbm, gmp, libffi }: + +with stdenv.lib; +stdenv.mkDerivation rec { + + name = "librep-git-2015-02-15"; + + src = fetchgit { + url = "https://github.com/SawfishWM/librep.git"; + rev = "a1f2db721aa5055e90f6a76fde625946340ed8cf"; + sha256 = "c91484d02b2408becc8961997c3d6404aefa8e1f8af4621a8b5f7622b1857fa6"; + }; + + buildInputs = [ pkgconfig autoreconfHook readline texinfo ]; + propagatedBuildInputs = [ gdbm gmp libffi ]; + + configureFlags = [ + "--disable-static" + ]; + + setupHook = ./setup-hook.sh; + + meta = { + description = "Lisp system for Sawfish"; + longDescription = '' + This is librep, a Lisp system for UNIX, needed by Sawfish window manager. + It contains a Lisp interpreter, byte-code compiler and virtual machine. + Applications may use the Lisp interpreter as an extension language, + or it may be used for stand-alone scripts. + + The Lisp dialect was originally inspired by Emacs Lisp, but with the worst + features removed. It also borrows many ideas from Scheme. + ''; + homepage = http://sawfish.wikia.com; + license = licenses.gpl2; + maintainers = [ maintainers.AndersonTorres ]; + }; +} diff --git a/pkgs/development/libraries/librep/setup-hook.sh b/pkgs/development/libraries/librep/setup-hook.sh new file mode 100644 index 000000000000..420d63d6c513 --- /dev/null +++ b/pkgs/development/libraries/librep/setup-hook.sh @@ -0,0 +1,5 @@ +addRepDLLoadPath () { + addToSearchPath REP_DL_LOAD_PATH $1/lib/rep +} + +envHooks+=(addRepDLLoadPath) diff --git a/pkgs/development/libraries/rep-gtk/default.nix b/pkgs/development/libraries/rep-gtk/default.nix new file mode 100644 index 000000000000..070baf7ae794 --- /dev/null +++ b/pkgs/development/libraries/rep-gtk/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchgit, pkgconfig, autoreconfHook, librep, gtk2 }: + +with stdenv.lib; +stdenv.mkDerivation rec { + + name = "rep-gtk-git-2015-02-15"; + + src = fetchgit { + url = "https://github.com/SawfishWM/rep-gtk.git"; + rev = "74ac3504f2bbbcc9ded005ab97cbf94cdc47924d"; + sha256 = "edb47c5b6d09201d16a8f0616d18690ff0a37dca56d31c6e635b286bd0b6a031"; + }; + + buildInputs = [ pkgconfig autoreconfHook ]; + propagatedBuildInputs = [ librep gtk2 ]; + + patchPhase = '' + sed -e 's|installdir=$(repexecdir)|installdir=$(libdir)/rep|g' -i Makefile.in + ''; + + meta = { + description = "GTK+ bindings for librep"; + homepage = http://sawfish.wikia.com; + license = licenses.gpl2; + maintainers = [ maintainers.AndersonTorres ]; + }; +} diff --git a/pkgs/development/libraries/rep-gtk/setup-hook.sh b/pkgs/development/libraries/rep-gtk/setup-hook.sh new file mode 100644 index 000000000000..420d63d6c513 --- /dev/null +++ b/pkgs/development/libraries/rep-gtk/setup-hook.sh @@ -0,0 +1,5 @@ +addRepDLLoadPath () { + addToSearchPath REP_DL_LOAD_PATH $1/lib/rep +} + +envHooks+=(addRepDLLoadPath) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a8572f4a71c6..89923dc420a7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10906,6 +10906,12 @@ let fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; }; }; + librep = callPackage ../development/libraries/librep { }; + + rep-gtk = callPackage ../development/libraries/rep-gtk { }; + + sawfish = callPackage ../applications/window-managers/sawfish { }; + sxhkd = callPackage ../applications/window-managers/sxhkd { }; msmtp = callPackage ../applications/networking/msmtp { };