at 22.05-pre 907 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 cfg = config.programs.bash.undistractMe; 7in 8{ 9 options = { 10 programs.bash.undistractMe = { 11 enable = mkEnableOption "notifications when long-running terminal commands complete"; 12 13 playSound = mkEnableOption "notification sounds when long-running terminal commands complete"; 14 15 timeout = mkOption { 16 default = 10; 17 description = '' 18 Number of seconds it would take for a command to be considered long-running. 19 ''; 20 type = types.int; 21 }; 22 }; 23 }; 24 25 config = mkIf cfg.enable { 26 programs.bash.promptPluginInit = '' 27 export LONG_RUNNING_COMMAND_TIMEOUT=${toString cfg.timeout} 28 export UDM_PLAY_SOUND=${if cfg.playSound then "1" else "0"} 29 . "${pkgs.undistract-me}/etc/profile.d/undistract-me.sh" 30 ''; 31 }; 32 33 meta = { 34 maintainers = with maintainers; [ kira-bruneau ]; 35 }; 36}