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
40 lines
937 B
Nix
40 lines
937 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.bash.undistractMe;
|
|
in
|
|
{
|
|
options = {
|
|
programs.bash.undistractMe = {
|
|
enable = lib.mkEnableOption "notifications when long-running terminal commands complete";
|
|
|
|
playSound = lib.mkEnableOption "notification sounds when long-running terminal commands complete";
|
|
|
|
timeout = lib.mkOption {
|
|
default = 10;
|
|
description = ''
|
|
Number of seconds it would take for a command to be considered long-running.
|
|
'';
|
|
type = lib.types.int;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
programs.bash.promptPluginInit = ''
|
|
export LONG_RUNNING_COMMAND_TIMEOUT=${builtins.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 lib.maintainers; [ kira-bruneau ];
|
|
};
|
|
}
|