Convert module which are declaring options into modules separated with an

"options" set to declare options and a "config" set to define options.

svn path=/nixos/trunk/; revision=17148
This commit is contained in:
Nicolas Pierron 2009-09-15 08:33:45 +00:00
parent 81ec373e1e
commit 36573e5e5c
4 changed files with 107 additions and 109 deletions

View File

@ -1,6 +1,7 @@
{pkgs, ...}:
{
options = {
environment.checkConfigurationOptions = pkgs.lib.mkOption {
default = true;
example = false;
@ -8,4 +9,5 @@
Whether to check the validity of the entire configuration.
'';
};
};
}

View File

@ -11,7 +11,7 @@ let
in
{
require = [
imports = [
./kde.nix
./kde4.nix
./gnome.nix
@ -19,13 +19,9 @@ in
./none.nix
];
services = {
xserver = {
displayManager = {
session = cfg.session.list;
};
options = {
services.xserver.desktopManager = {
desktopManager = {
session = mkOption {
default = [];
example = [{
@ -66,11 +62,13 @@ in
else
throw "Default desktop manager ($(defaultDM)) not found.";
};
};
};
};
environment = mkIf cfg.session.needBGPackages {
x11Packages = [ pkgs.feh ];
config = {
services.xserver.displayManager.session = cfg.session.list;
environment.x11Packages =
mkIf cfg.session.needBGPackages [ pkgs.feh ];
};
}

View File

@ -6,7 +6,7 @@ let
in
{
require = [
imports = [
./compiz.nix
./kwm.nix
./metacity.nix
@ -16,13 +16,9 @@ in
./xmonad.nix
];
services = {
xserver = {
displayManager = {
session = cfg.session;
};
options = {
services.xserver.windowManager = {
windowManager = {
session = mkOption {
default = [];
example = [{
@ -52,7 +48,11 @@ in
else
throw "Default window manager (${defaultWM}) not found.";
};
};
};
config = {
services.xserver.displayManager.session = cfg.session;
};
}

View File

@ -6,18 +6,18 @@ let
in
{
services = {
xserver = {
windowManager = {
xmonad = {
options = {
services.xserver.windowManager.xmonad = {
enable = mkOption {
default = false;
example = true;
description = "Enable the xmonad window manager.";
};
};
};
config = {
services.xserver.windowManager = {
session = mkIf cfg.enable [{
name = "xmonad";
start = "
@ -26,7 +26,5 @@ in
";
}];
};
};
};
}