1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 configFile = ./xfs.conf;
8
9in
10
11{
12
13 ###### interface
14
15 options = {
16
17 services.xfs = {
18
19 enable = mkOption {
20 type = types.bool;
21 default = false;
22 description = "Whether to enable the X Font Server.";
23 };
24
25 };
26
27 };
28
29
30 ###### implementation
31
32 config = mkIf config.services.xfs.enable {
33
34 assertions = singleton
35 { assertion = config.fonts.enableFontDir;
36 message = "Please enable fonts.enableFontDir to use the X Font Server.";
37 };
38
39 jobs.xfs =
40 { description = "X Font Server";
41
42 startOn = "started networking";
43
44 exec = "${pkgs.xorg.xfs}/bin/xfs -config ${configFile}";
45 };
46
47 };
48
49}