e91d882a94
style of declaring Upstart jobs. While at it, converted them to the current NixOS module style and improved some option descriptions. Hopefully I didn't break too much :-) svn path=/nixos/trunk/; revision=17761
54 lines
883 B
Nix
54 lines
883 B
Nix
{ config, pkgs, ... }:
|
|
|
|
with pkgs.lib;
|
|
|
|
let
|
|
|
|
configFile = ./xfs.conf;
|
|
|
|
startingDependency =
|
|
if config.services.gw6c.enable && config.services.gw6c.autorun
|
|
then "gw6c"
|
|
else "network-interfaces";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.xfs = {
|
|
|
|
enable = mkOption {
|
|
default = false;
|
|
description = "Whether to enable the X Font Server.";
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.services.xfs.enable {
|
|
|
|
assertions = singleton
|
|
{ assertion = config.fonts.enableFontDir;
|
|
message = "Please enable fontDir (fonts.enableFontDir) to use xfs.";
|
|
};
|
|
|
|
jobAttrs.xfs =
|
|
{ description = "X Font Server";
|
|
|
|
startOn = "${startingDependency}/started";
|
|
stopOn = "shutdown";
|
|
|
|
exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}";
|
|
};
|
|
|
|
};
|
|
|
|
}
|