fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . sqls ; 8 9yamlFormat = pkgs . formats . yaml { }; 10 11in { 12meta . maintainers = [ ]; 13 14options . programs . sqls = { 15enable = mkEnableOption "sqls, a SQL language server written in Go" ; 16 17settings = mkOption { 18type = yamlFormat . type ; 19default = { }; 20example = literalExpression '' 21{ 22lowercaseKeywords = true; 23connections = [ 24{ 25driver = "mysql"; 26dataSourceName = "root:root@tcp(127.0.0.1:13306)/world"; 27} 28]; 29} 30'' ; 31description = '' 32Configuration written to 33{file}`$XDG_CONFIG_HOME/sqls/config.yml`. See 34<https://github.com/lighttiger2505/sqls#db-configuration> 35for supported values. 36'' ; 37}; 38}; 39 40config = mkIf cfg . enable { 41home . packages = [ pkgs . sqls ]; 42 43xdg . configFile . "sqls/config.yml" = mkIf ( cfg . settings != { }) { 44source = yamlFormat . generate "sqls-config" cfg . settings ; 45}; 46}; 47}