1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/piston-cli.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

44 lines
990 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.piston-cli;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = with lib.maintainers; [ ethancedwards8 ];
options.programs.piston-cli = {
enable = lib.mkEnableOption "piston-cli, code runner";
package = lib.mkPackageOption pkgs "piston-cli" { };
settings = lib.mkOption {
type = yamlFormat.type;
default = { };
example = lib.literalExpression ''
{
theme = "emacs";
box_style = "MINIMAL_DOUBLE_HEAD";
prompt_continuation = "...";
prompt_start = ">>>";
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/piston-cli/config.yml`.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."piston-cli/config.yml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "config.yml" cfg.settings;
};
};
}