Convert "xfs", problems when enabling warning!

svn path=/nixos/branches/fix-style/; revision=14388
This commit is contained in:
Marc Weber 2009-03-06 12:26:57 +00:00
parent 030a30b4b6
commit aa78690465
3 changed files with 50 additions and 33 deletions

View File

@ -479,18 +479,6 @@ in
};
xfs = {
enable = mkOption {
default = false;
description = "
Whether to enable the X Font Server.
";
};
};
mysql = {
enable = mkOption {
default = false;
@ -901,6 +889,7 @@ in
(import ../upstart-jobs/udev.nix) # The udev daemon creates devices nodes and runs programs when hardware events occur.
(import ../upstart-jobs/samba.nix) # TODO: doesn't start here (?)
(import ../upstart-jobs/ircd-hybrid.nix) # TODO: doesn't compile on x86_64-linux, can't test
(import ../upstart-jobs/xfs.nix)
# nix
(import ../upstart-jobs/nix.nix) # nix options and daemon

View File

@ -149,12 +149,6 @@ let
inherit config pkgs;
})
# X Font Server
++ optional config.services.xfs.enable
(import ../upstart-jobs/xfs.nix {
inherit config pkgs;
})
# Postfix mail server.
++ optional config.services.postfix.enable
(import ../upstart-jobs/postfix.nix {

View File

@ -1,20 +1,54 @@
{
pkgs, config
}:
if ! config.fonts.enableFontDir then abort "Please enable fontDir (fonts.enableFontDir) to use xfs." else
{pkgs, config, ...}:
###### interface
let
configFile = ./xfs.conf;
inherit (pkgs.lib) mkOption mkIf;
options = {
services = {
xfs = {
enable = mkOption {
default = false;
description = "
Whether to enable the X Font Server.
";
};
};
};
};
in
###### implementation
# FIXME: enable this warning again. It's causing "infinite recursion encountered, why?"
# if ! config.fonts.enableFontDir then throw "Please enable fontDir (fonts.enableFontDir) to use xfs." else
let
configFile = ./xfs.conf;
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
in
rec {
name = "xfs";
groups = [];
users = [];
job = "
description \"X Font Server\"
start on ${startingDependency}/started
stop on shutdown
respawn ${pkgs.xorg.xfs}/bin/xfs -config ${configFile}
";
mkIf config.services.xfs.enable {
require = [
options
];
services = {
extraJobs = [ (rec {
name = "xfs";
groups = [];
users = [];
job = ''
description "X Font Server"
start on ${startingDependency}/started
stop on shutdown
respawn ${pkgs.xorg.xfs}/bin/xfs -config ${configFile}
'';
})];
};
}