1 { config, lib, pkgs, ... }:
6 cfg = config.services.dictd;
20 description = lib.mdDoc ''
21 Whether to enable the DICT.org dictionary server.
26 type = types.listOf types.package;
27 default = with pkgs.dictdDBs; [ wiktionary wordnet ];
28 defaultText = literalExpression "with pkgs.dictdDBs; [ wiktionary wordnet ]";
29 example = literalExpression "[ pkgs.dictdDBs.nld2eng ]";
30 description = lib.mdDoc "List of databases to make available.";
40 config = let dictdb = pkgs.dictDBCollector { dictlist = map (x: {
42 filename = x; } ) cfg.DBs; };
45 # get the command line client on system path to make some use of the service
46 environment.systemPackages = [ pkgs.dict ];
48 environment.etc."dict.conf".text = ''
54 description = "DICT.org dictd server";
55 home = "${dictdb}/share/dictd";
56 uid = config.ids.uids.dictd;
59 users.groups.dictd.gid = config.ids.gids.dictd;
61 systemd.services.dictd = {
62 description = "DICT.org Dictionary Server";
63 wantedBy = [ "multi-user.target" ];
64 environment = { LOCALE_ARCHIVE = "/run/current-system/sw/lib/locale/locale-archive"; };
65 serviceConfig.Type = "forking";
66 script = "${pkgs.dict}/sbin/dictd -s -c ${dictdb}/share/dictd/dictd.conf --locale en_US.UTF-8";