{ pkgs, config, lib, ... }: with lib; let cfg = config.eboskma.programs.gitu; settingsFormat = pkgs.formats.toml { }; gituConfig = types.submodule { freeformType = settingsFormat.type; }; in { options.eboskma.programs.gitu = { enable = mkEnableOption "gitu"; settings = mkOption { description = "Gitu config according to https://github.com/altsem/gitu/blob/master/src/default_config.toml"; default = { }; type = gituConfig; }; }; config = mkIf cfg.enable { xdg.configFile.gitu = { target = "gitu/config.toml"; source = settingsFormat.generate "config.toml" cfg.settings; }; home.packages = [ pkgs.gitu ]; }; }