1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7 8with lib; 9 10let 11 cfg = config.services.xserver.windowManager.mlvwm; 12 13in 14{ 15 16 options.services.xserver.windowManager.mlvwm = { 17 enable = mkEnableOption "Macintosh-like Virtual Window Manager"; 18 19 configFile = mkOption { 20 default = null; 21 type = with types; nullOr path; 22 description = '' 23 Path to the mlvwm configuration file. 24 If left at the default value, $HOME/.mlvwmrc will be used. 25 ''; 26 }; 27 }; 28 29 config = mkIf cfg.enable { 30 31 services.xserver.windowManager.session = [ 32 { 33 name = "mlvwm"; 34 start = '' 35 ${pkgs.mlvwm}/bin/mlvwm ${optionalString (cfg.configFile != null) "-f /etc/mlvwm/mlvwmrc"} & 36 waitPID=$! 37 ''; 38 } 39 ]; 40 41 environment.etc."mlvwm/mlvwmrc" = mkIf (cfg.configFile != null) { 42 source = cfg.configFile; 43 }; 44 45 environment.systemPackages = [ pkgs.mlvwm ]; 46 }; 47}