about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/x11/window-managers/fvwm2.nix
blob: b5ef36f58d54cbdb2b1d0126eea1dd06ce4680e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ config, lib, pkgs, ... }:

with lib;

let
  cfg = config.services.xserver.windowManager.fvwm2;
  fvwm2 = pkgs.fvwm2.override { enableGestures = cfg.gestures; };
in

{

  imports = [
    (mkRenamedOptionModule
      [ "services" "xserver" "windowManager" "fvwm" ]
      [ "services" "xserver" "windowManager" "fvwm2" ])
  ];

  ###### interface

  options = {
    services.xserver.windowManager.fvwm2 = {
      enable = mkEnableOption "Fvwm2 window manager";

      gestures = mkOption {
        default = false;
        type = types.bool;
        description = lib.mdDoc "Whether or not to enable libstroke for gesture support";
      };
    };
  };


  ###### implementation

  config = mkIf cfg.enable {
    services.xserver.windowManager.session = singleton
      { name = "fvwm2";
        start =
          ''
            ${fvwm2}/bin/fvwm &
            waitPID=$!
          '';
      };

    environment.systemPackages = [ fvwm2 ];
  };
}