1{ config, lib, pkgs, ... }:
2
3with lib;
4let
5 cfg = config.services.xserver.windowManager.wmii;
6 wmii = pkgs.wmii_hg;
7in
8{
9 options = {
10 services.xserver.windowManager.wmii.enable = mkEnableOption "wmii";
11 };
12
13 config = mkIf cfg.enable {
14 services.xserver.windowManager.session = singleton
15 # stop wmii by
16 # $wmiir xwrite /ctl quit
17 # this will cause wmii exiting with exit code 0
18 # (or "mod+a quit", which is bound to do the same thing in wmiirc
19 # by default)
20 #
21 # why this loop?
22 # wmii crashes once a month here. That doesn't matter that much
23 # wmii can recover very well. However without loop the X session
24 # terminates and then your workspace setup is lost and all
25 # applications running on X will terminate.
26 # Another use case is kill -9 wmii; after rotating screen.
27 # Note: we don't like kill for that purpose. But it works (->
28 # subject "wmii and xrandr" on mailinglist)
29 { name = "wmii";
30 start = ''
31 while :; do
32 ${wmii}/bin/wmii && break
33 done
34 '';
35 };
36
37 environment.systemPackages = [ wmii ];
38 };
39}