2009-03-06 12:26:57 +00:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
let
|
|
|
|
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
|
|
|
|
|
2007-11-05 08:54:30 +00:00
|
|
|
let
|
2009-03-06 12:26:57 +00:00
|
|
|
configFile = ./xfs.conf;
|
2008-01-14 11:24:36 +00:00
|
|
|
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
|
2007-11-05 08:54:30 +00:00
|
|
|
in
|
2009-03-06 12:26:57 +00:00
|
|
|
|
|
|
|
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}
|
|
|
|
'';
|
|
|
|
})];
|
|
|
|
};
|
2007-11-05 08:54:30 +00:00
|
|
|
}
|