Files
home-manager/modules/programs/piston-cli.nix
Austin Horstman 355734d876 treewide: remove literalExpression where unneeded
`literalExpression` is intended just to signify code that needs to stay
a string that gets represented exactly as-is for docs. It has been
misused heavily and people get confused repeatedly on when or not to use
it because of the rampant misuse.
2026-05-17 21:43:25 -05:00

43 lines
941 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 {
inherit (yamlFormat) type;
default = { };
example = {
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;
};
};
}