2009-01-25 16:49:08 +01:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
let
|
2009-01-25 16:49:18 +01:00
|
|
|
inherit (pkgs.lib) mkOption mergeOneOption any;
|
2009-01-25 16:49:08 +01:00
|
|
|
cfg = config.services.xserver.windowManager;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2009-09-15 10:33:45 +02:00
|
|
|
imports = [
|
2009-05-20 01:14:45 +02:00
|
|
|
./compiz.nix
|
|
|
|
./kwm.nix
|
|
|
|
./metacity.nix
|
|
|
|
./none.nix
|
|
|
|
./twm.nix
|
|
|
|
./wmii.nix
|
|
|
|
./xmonad.nix
|
2009-01-25 16:49:08 +01:00
|
|
|
];
|
|
|
|
|
2009-09-15 10:33:45 +02:00
|
|
|
options = {
|
|
|
|
services.xserver.windowManager = {
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-15 10:33:45 +02:00
|
|
|
session = mkOption {
|
|
|
|
default = [];
|
|
|
|
example = [{
|
|
|
|
name = "wmii";
|
|
|
|
start = "...";
|
|
|
|
}];
|
|
|
|
description = "
|
|
|
|
Internal option used to add some common line to window manager
|
|
|
|
scripts before forwarding the value to the
|
|
|
|
<varname>displayManager</varname>.
|
|
|
|
";
|
|
|
|
apply = map (d: d // {
|
|
|
|
manage = "window";
|
|
|
|
});
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
|
2009-09-15 10:33:45 +02:00
|
|
|
default = mkOption {
|
|
|
|
default = "none";
|
|
|
|
example = "wmii";
|
|
|
|
description = "
|
|
|
|
Default window manager loaded if none have been chosen.
|
|
|
|
";
|
|
|
|
merge = mergeOneOption;
|
|
|
|
apply = defaultWM:
|
|
|
|
if any (w: w.name == defaultWM) cfg.session then
|
|
|
|
defaultWM
|
|
|
|
else
|
|
|
|
throw "Default window manager (${defaultWM}) not found.";
|
2009-01-25 16:49:08 +01:00
|
|
|
};
|
2009-09-15 10:33:45 +02:00
|
|
|
|
2009-01-25 16:49:08 +01:00
|
|
|
};
|
|
|
|
};
|
2009-09-15 10:33:45 +02:00
|
|
|
|
|
|
|
config = {
|
|
|
|
services.xserver.displayManager.session = cfg.session;
|
|
|
|
};
|
2009-01-25 16:49:08 +01:00
|
|
|
}
|