Something went wrong. Try again.
NixOS / Nix-darwin / Home Manager dotfiles for my devices
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{ self, ...}:let common = { pkgs, ... }: { services.dictd = { enable = true; DBs = [ pkgs.webster-1913-dictd ]; }; };in{ flake = { modules.nixos.dictionary = common;
modules.darwin.dictionary = { imports = [ self.darwinModules.dictd common ]; };
darwinModules.dictd = { config, lib, pkgs, ... }: { options.services.dictd = { enable = lib.mkEnableOption "DICT.org dictionary server"; DBs = lib.mkOption { type = lib.types.listOf lib.types.package; default = with pkgs.dictdDBs; [ wiktionary wordnet ]; }; }; config = let dictdb = pkgs.dictDBCollector { dictlist = map (x: { inherit (x) name; filename = x; }) config.services.dictd.DBs; }; in lib.mkIf config.services.dictd.enable { environment.systemPackages = [ pkgs.dict ]; environment.etc."dict.conf".text = '' server localhost ''; launchd.daemons.dictd = { command = "${pkgs.dict}/sbin/dictd -c ${dictdb}/share/dictd/dictd.conf --locale en_US.UTF-8"; serviceConfig = { KeepAlive = true; RunAtLoad = true; }; }; }; }; };}