Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
51 lines
1.0 KiB
Nix
51 lines
1.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.iay;
|
|
inherit (lib)
|
|
mkEnableOption
|
|
mkIf
|
|
mkOption
|
|
mkPackageOption
|
|
optionalString
|
|
types
|
|
;
|
|
in
|
|
{
|
|
options.programs.iay = {
|
|
enable = mkEnableOption "iay, a minimalistic shell prompt";
|
|
package = mkPackageOption pkgs "iay" { };
|
|
|
|
minimalPrompt = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "Use minimal one-liner prompt.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.bash.promptInit = ''
|
|
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
|
|
PS1='$(iay ${optionalString cfg.minimalPrompt "-m"})'
|
|
fi
|
|
'';
|
|
|
|
programs.zsh.promptInit = ''
|
|
if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then
|
|
autoload -Uz add-zsh-hook
|
|
_iay_prompt() {
|
|
PROMPT="$(iay -z ${optionalString cfg.minimalPrompt "-m"})"
|
|
}
|
|
add-zsh-hook precmd _iay_prompt
|
|
fi
|
|
'';
|
|
};
|
|
|
|
meta.maintainers = pkgs.iay.meta.maintainers;
|
|
}
|