2009-03-06 13:26:57 +01: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
|
|
|
|
|
|
|
|
|
2007-11-05 09:54:30 +01:00
|
|
|
let
|
2009-03-06 13:26:57 +01:00
|
|
|
configFile = ./xfs.conf;
|
2008-01-14 12:24:36 +01:00
|
|
|
startingDependency = if config.services.gw6c.enable && config.services.gw6c.autorun then "gw6c" else "network-interfaces";
|
2007-11-05 09:54:30 +01:00
|
|
|
in
|
2009-03-06 13:26:57 +01:00
|
|
|
|
|
|
|
mkIf config.services.xfs.enable {
|
2009-04-30 04:29:58 +02:00
|
|
|
|
2009-07-08 11:10:26 +02:00
|
|
|
assertions = [ { assertion = config.fonts.enableFontDir; message = "Please enable fontDir (fonts.enableFontDir) to use xfs."; } ];
|
2009-04-30 04:29:58 +02:00
|
|
|
|
2009-03-06 13:26:57 +01:00
|
|
|
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 09:54:30 +01:00
|
|
|
}
|