fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6cfg = config . programs . piston-cli ; 7yamlFormat = pkgs . formats . yaml { }; 8in { 9meta . maintainers = with maintainers ; [ ethancedwards8 ]; 10 11options . programs . piston-cli = { 12enable = mkEnableOption "piston-cli, code runner" ; 13 14package = mkOption { 15type = types . package ; 16default = pkgs . piston-cli ; 17defaultText = literalExpression "pkgs.piston-cli" ; 18description = "The piston-cli package to use." ; 19}; 20 21settings = mkOption { 22type = yamlFormat . type ; 23default = { }; 24example = literalExpression '' 25{ 26theme = "emacs"; 27box_style = "MINIMAL_DOUBLE_HEAD"; 28prompt_continuation = "..."; 29prompt_start = ">>>"; 30} 31'' ; 32description = '' 33Configuration written to 34{file}`$XDG_CONFIG_HOME/piston-cli/config.yml`. 35'' ; 36}; 37}; 38 39config = mkIf cfg . enable { 40home . packages = [ cfg . package ]; 41 42xdg . configFile . "piston-cli/config.yml" = mkIf ( cfg . settings != { }) { 43source = yamlFormat . generate "config.yml" cfg . settings ; 44}; 45}; 46}