mirror of
https://github.com/traxys/Nixfiles.git
synced 2026-02-15 11:50:21 +01:00
43 lines
920 B
Nix
43 lines
920 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: {
|
|
options = {
|
|
workAddr = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
|
|
config = {
|
|
workAddr = "quentin.boyer@***REMOVED***";
|
|
|
|
home.packages = [
|
|
(pkgs.writeShellScriptBin "gpt" ''
|
|
#!/usr/bin/env bash
|
|
|
|
if [[ "$1" = "--" ]]; then
|
|
shift
|
|
elif [[ -n "$2" ]]; then
|
|
VER=" $1"
|
|
shift
|
|
fi
|
|
|
|
DIR="$(basename "$(git rev-parse --show-toplevel)")"
|
|
git format-patch --subject-prefix="PATCH $DIR$VER" "$@"
|
|
'')
|
|
(pkgs.writeShellScriptBin "nwadminSendmail" ''
|
|
#!/usr/bin/env sh
|
|
# shellcheck disable=SC2029
|
|
|
|
ssh nwadmin "/usr/sbin/sendmail -r ${config.workAddr} $*"
|
|
exit $?
|
|
'')
|
|
];
|
|
|
|
programs.zsh.shellAliases = {
|
|
gemail = ''git send-email --sendmail-cmd="nwadminSendmail" --to="dl-bxi-sw-ll-patches@***REMOVED***"'';
|
|
};
|
|
};
|
|
}
|