bins: initial bits for rpr

This commit is contained in:
Aaron Bieber 2023-01-10 18:35:29 -07:00
parent d673020964
commit f097cbf577
No known key found for this signature in database
2 changed files with 30 additions and 1 deletions

View File

@ -12,13 +12,19 @@ let
inherit gosignify; inherit gosignify;
inherit (pkgs) curl; inherit (pkgs) curl;
}); });
rpr = pkgs.writeScriptBin "rpr" (import ./rpr.nix {
inherit (pkgs) _1password;
inherit (pkgs) gh;
inherit (pkgs) tea;
});
in { in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
checkRestart
ix ix
#rpr
sfetch sfetch
xclip xclip
checkRestart
xinStatus xinStatus
]; ];
environment.etc = { environment.etc = {

23
bins/rpr.nix Normal file
View File

@ -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'"
''