{ pkgs }: pkgs.symlinkJoin { name = "alacritty-tv"; paths = [ (pkgs.writeDashBin "alacritty" '' # usage: # alacritty [--profile=PROFILE] [--singleton] [ARGS...] # where # PROFILE must have a corresponding file /etc/alacritty/PROFILE.json set -efu profile=default case ''${1-} in --profile=*) profile=''${1#--profile=} shift esac config=/etc/alacritty/$profile.json if ! test -e "$config"; then echo "$0: warning: bad profile: $profile; using default instead" >&2 profile=default config=/etc/alacritty/default.json fi case ''${1-} in --singleton) shift if ! ${pkgs.alacritty}/bin/alacritty --config-file "$config" msg create-window "$@"; then ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" & fi ;; *) exec ${pkgs.alacritty}/bin/alacritty --config-file "$config" "$@" ;; esac '') pkgs.alacritty ]; }