treewide: implement auto importing for modules
Reduce maintenance burden and increase efficiency by automatically importing modules following a specific convention. Co-authored-by: awwpotato <awwpotato@voidq.com> Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
fefeb0e928
commit
4fca600cb1
461 changed files with 72 additions and 474 deletions
44
modules/programs/piston-cli/default.nix
Normal file
44
modules/programs/piston-cli/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue