1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 10:49:48 +01:00

piston-cli: add module (#2052)

* piston-cli: add module

* News: Remove trailing whitespace
This commit is contained in:
Ethan Edwards 2021-06-07 10:07:15 -04:00 committed by GitHub
parent 3ffe2a4cdf
commit 9424f31f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -148,6 +148,8 @@
/modules/programs/pidgin.nix @rycee
/modules/programs/piston-cli.nix @ethancedwards8
/modules/programs/powerline-go.nix @DamienCassou
/modules/programs/rbw.nix @ambroisie

View file

@ -2054,6 +2054,13 @@ in
A new module is available: 'programs.rbw'.
'';
}
{
time = "2021-05-30T15:22:10+00:00";
message = ''
A new module is available: 'programs.piston-cli'.
'';
}
];
};
}

View file

@ -118,6 +118,7 @@ let
(loadModule ./programs/pazi.nix { })
(loadModule ./programs/pet.nix { })
(loadModule ./programs/pidgin.nix { })
(loadModule ./programs/piston-cli.nix { })
(loadModule ./programs/powerline-go.nix { })
(loadModule ./programs/qutebrowser.nix { })
(loadModule ./programs/rbw.nix { })

View file

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