mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
37 lines
941 B
Nix
37 lines
941 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.programs.bash.undistractMe;
|
|
in
|
|
{
|
|
options = {
|
|
programs.bash.undistractMe = {
|
|
enable = mkEnableOption (lib.mdDoc "notifications when long-running terminal commands complete");
|
|
|
|
playSound = mkEnableOption (lib.mdDoc "notification sounds when long-running terminal commands complete");
|
|
|
|
timeout = mkOption {
|
|
default = 10;
|
|
description = lib.mdDoc ''
|
|
Number of seconds it would take for a command to be considered long-running.
|
|
'';
|
|
type = types.int;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.bash.promptPluginInit = ''
|
|
export LONG_RUNNING_COMMAND_TIMEOUT=${toString cfg.timeout}
|
|
export UDM_PLAY_SOUND=${if cfg.playSound then "1" else "0"}
|
|
. "${pkgs.undistract-me}/etc/profile.d/undistract-me.sh"
|
|
'';
|
|
};
|
|
|
|
meta = {
|
|
maintainers = with maintainers; [ kira-bruneau ];
|
|
};
|
|
}
|