summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/services/x11/window-managers/clfswm.nix31
-rw-r--r--nixos/modules/services/x11/window-managers/default.nix1
-rw-r--r--pkgs/applications/window-managers/clfswm/default.nix43
-rw-r--r--pkgs/applications/window-managers/clfswm/require-clx.patch13
-rw-r--r--pkgs/top-level/all-packages.nix2
5 files changed, 90 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/window-managers/clfswm.nix b/nixos/modules/services/x11/window-managers/clfswm.nix
new file mode 100644
index 00000000000..9d8eecb56c7
--- /dev/null
+++ b/nixos/modules/services/x11/window-managers/clfswm.nix
@@ -0,0 +1,31 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.xserver.windowManager.clfswm;
+in
+
+{
+  options = {
+    services.xserver.windowManager.clfswm = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        example = true;
+        description = "Enable the clfswm tiling window manager.";
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    services.xserver.windowManager.session = singleton {
+      name = "clfswm";
+      start = ''
+        ${pkgs.clfswm}/bin/clfswm &
+        waitPID=$!
+      '';
+    };
+    environment.systemPackages = [ pkgs.clfswm ];
+  };
+}
diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix
index 4751de07a15..31f42f5ffb9 100644
--- a/nixos/modules/services/x11/window-managers/default.nix
+++ b/nixos/modules/services/x11/window-managers/default.nix
@@ -10,6 +10,7 @@ in
   imports = [
     ./afterstep.nix
     ./bspwm.nix
+    ./clfswm.nix
     ./compiz.nix
     ./fluxbox.nix
     ./herbstluftwm.nix
diff --git a/pkgs/applications/window-managers/clfswm/default.nix b/pkgs/applications/window-managers/clfswm/default.nix
new file mode 100644
index 00000000000..6eb55348e60
--- /dev/null
+++ b/pkgs/applications/window-managers/clfswm/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, pkgs, fetchgit, autoconf, sbcl, lispPackages, xdpyinfo, texinfo4
+, makeWrapper , rlwrap, gnused, gnugrep, coreutils, xprop
+, extraModulePaths ? [] }:
+
+stdenv.mkDerivation rec {
+  name = "clfswm";
+
+  src = fetchgit {
+    url = "https://gitlab.common-lisp.net/clfswm/clfswm.git";
+    rev = "refs/heads/master";
+    sha256 = "1hkm6bn5xww932w34l13bg87m5hsnwnd0i1lka6sw0cq8whndya0";
+  };
+
+  buildInputs = [
+    texinfo4 makeWrapper autoconf
+    sbcl
+    lispPackages.clx
+    lispPackages.cl-ppcre
+    xdpyinfo
+  ];
+
+  patches = [ ./require-clx.patch ];
+
+  # Stripping destroys the generated SBCL image
+  dontStrip = true;
+
+  installPhase = ''
+    mkdir -pv $out/bin
+    make DESTDIR=$out install
+
+    # Paths in the compressed image $out/bin/clfswm are not
+    # recognized by Nix. Add explicit reference here.
+    mkdir $out/nix-support
+    echo ${xdpyinfo} ${lispPackages.clx} ${lispPackages.cl-ppcre} > $out/nix-support/depends
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A(nother) Common Lisp FullScreen Window Manager";
+    homepage    = https://common-lisp.net/project/clfswm/;
+    license     = licenses.gpl3;
+    platforms   = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/clfswm/require-clx.patch b/pkgs/applications/window-managers/clfswm/require-clx.patch
new file mode 100644
index 00000000000..ae2234461d2
--- /dev/null
+++ b/pkgs/applications/window-managers/clfswm/require-clx.patch
@@ -0,0 +1,13 @@
+diff --git a/load.lisp b/load.lisp
+index c8c4cf0..8c9ca2e 100644
+--- a/load.lisp
++++ b/load.lisp
+@@ -111,6 +111,8 @@ from $XDG_CONFIG_HOME/clfswm/clfswmrc")
+ ;;;------------------
+ (load-info "Requiring CLX")
+ 
++(require 'clx)
++
+ ;;; Loading clisp dynamic module. This part needs clisp >= 2.50
+ ;;#+(AND CLISP (not CLX))
+ ;;(when (fboundp 'require)
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3ad13b48748..5f0f385865e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11095,6 +11095,8 @@ let
     enableNetworkManager = config.networking.networkmanager.enable or false;
   };
 
+  clfswm = callPackage ../applications/window-managers/clfswm { };
+
   clipgrab = callPackage ../applications/video/clipgrab { };
 
   clipit = callPackage ../applications/misc/clipit { };