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