Merge pull request #207797 from omasanori/iay-module
nixos/iay: add module; iay: add myself as a maintainer
This commit is contained in:
commit
6124309e74
3 changed files with 40 additions and 3 deletions
|
@ -179,6 +179,7 @@
|
||||||
./programs/haguichi.nix
|
./programs/haguichi.nix
|
||||||
./programs/hamster.nix
|
./programs/hamster.nix
|
||||||
./programs/htop.nix
|
./programs/htop.nix
|
||||||
|
./programs/iay.nix
|
||||||
./programs/iftop.nix
|
./programs/iftop.nix
|
||||||
./programs/i3lock.nix
|
./programs/i3lock.nix
|
||||||
./programs/iotop.nix
|
./programs/iotop.nix
|
||||||
|
|
37
nixos/modules/programs/iay.nix
Normal file
37
nixos/modules/programs/iay.nix
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.programs.iay;
|
||||||
|
inherit (lib) mkEnableOption mkIf mkOption mkPackageOption optionalString types;
|
||||||
|
in {
|
||||||
|
options.programs.iay = {
|
||||||
|
enable = mkEnableOption (lib.mdDoc "iay");
|
||||||
|
package = mkPackageOption pkgs "iay" {};
|
||||||
|
|
||||||
|
minimalPrompt = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = lib.mdDoc "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;
|
||||||
|
}
|
|
@ -38,10 +38,9 @@ rustPlatform.buildRustPackage rec {
|
||||||
NIX_LDFLAGS = lib.optionals stdenv.isDarwin [ "-framework" "AppKit" ];
|
NIX_LDFLAGS = lib.optionals stdenv.isDarwin [ "-framework" "AppKit" ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description =
|
description = "Minimalistic, blazing-fast, and extendable prompt for bash and zsh";
|
||||||
"Minimalistic, blazing-fast, and extendable prompt for bash and zsh";
|
|
||||||
homepage = "https://github.com/aaqaishtyaq/iay";
|
homepage = "https://github.com/aaqaishtyaq/iay";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = with maintainers; [ aaqaishtyaq ];
|
maintainers = with maintainers; [ aaqaishtyaq omasanori ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue