diff --git a/bins/default.nix b/bins/default.nix index d5a0d5e..912f81e 100644 --- a/bins/default.nix +++ b/bins/default.nix @@ -12,13 +12,19 @@ let inherit gosignify; inherit (pkgs) curl; }); + rpr = pkgs.writeScriptBin "rpr" (import ./rpr.nix { + inherit (pkgs) _1password; + inherit (pkgs) gh; + inherit (pkgs) tea; + }); in { environment.systemPackages = with pkgs; [ + checkRestart ix + #rpr sfetch xclip - checkRestart xinStatus ]; environment.etc = { diff --git a/bins/rpr.nix b/bins/rpr.nix new file mode 100644 index 0000000..222e8b0 --- /dev/null +++ b/bins/rpr.nix @@ -0,0 +1,23 @@ +{ tea, gh, _1password }: + +let + teaBin = "${tea}/bin/tea"; + ghBin = "${gh}/bin/gh"; + opBin = "${_1password}/bin/op"; + +in '' + #!/usr/bin/env sh + + set -eu + + proj="$(basename $PWD)" + + for login in $(${teaBin} logins list -o simple | awk '{print $1}'); do + tea logins default "$login" + tea repos create -name "$proj" || echo "error creating '$proj' on '$login'" + done + + # ${ghBin} + ${opBin} plugin run -- gh repo create --public "$proj" || echo "error creating '$proj' on 'github'" + +''