mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 05:24:52 +00:00
gh repos and fix mac build
This commit is contained in:
parent
8a22c80b2d
commit
35a57d2905
@ -19,7 +19,7 @@ darwin.lib.darwinSystem {
|
||||
../../modules/applications/discord.nix
|
||||
../../modules/programming/nix.nix
|
||||
../../modules/programming/terraform.nix
|
||||
../../modules/programming/python.nix
|
||||
# ../../modules/programming/python.nix
|
||||
../../modules/programming/lua.nix
|
||||
../../modules/programming/kubernetes.nix
|
||||
];
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
{ config, ... }: {
|
||||
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
@ -12,4 +12,7 @@
|
||||
./utilities.nix
|
||||
];
|
||||
|
||||
home-manager.users.${config.user}.home.stateVersion = "22.11";
|
||||
home-manager.users.root.home.stateVersion = "22.11";
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
visidata # CSV inspector
|
||||
# visidata # CSV inspector
|
||||
dos2unix # Convert Windows text files
|
||||
inetutils # Includes telnet
|
||||
youtube-dl # Convert web videos
|
||||
|
@ -1,9 +1,15 @@
|
||||
{ config, pkgs, ... }: {
|
||||
|
||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
||||
python310 # Standard Python interpreter
|
||||
nodePackages.pyright # Python language server
|
||||
black # Python formatter
|
||||
];
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# python310 # Standard Python interpreter
|
||||
nodePackages.pyright # Python language server
|
||||
black # Python formatter
|
||||
];
|
||||
|
||||
programs.fish.shellAbbrs = { py = "python"; };
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -117,11 +117,6 @@
|
||||
dr = "docker run --rm -it";
|
||||
db = "docker build . -t";
|
||||
|
||||
# Python
|
||||
py = "python";
|
||||
po = "poetry";
|
||||
pr = "poetry run python";
|
||||
|
||||
# Rust
|
||||
ca = "cargo";
|
||||
|
||||
|
@ -32,6 +32,48 @@
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
(pkgs.writeShellScriptBin "gh-repos" ''
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
t2) organization="take-two" ;;
|
||||
d2c) organization="take-two-t2gp" ;;
|
||||
t2gp) organization="take-two-t2gp" ;;
|
||||
pd) organization="private-division" ;;
|
||||
dots) organization="playdots" ;;
|
||||
*) organization="nmasur" ;;
|
||||
esac
|
||||
|
||||
selected=$(gh repo list "$organization" \
|
||||
--limit 50 \
|
||||
--no-archived \
|
||||
--json=name,description,isPrivate,updatedAt,primaryLanguage \
|
||||
| jq -r '.[] | .name + "," + if .description == "" then "-" else .description |= gsub(","; " ") | .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
|
||||
| (echo "REPO,DESCRIPTION,UPDATED,LANGUAGE"; cat -) \
|
||||
| column -s , -t \
|
||||
| fzf \
|
||||
--header-lines=1 \
|
||||
--layout=reverse \
|
||||
--bind "ctrl-o:execute:gh repo view -w ''${organization}/{1}" \
|
||||
--bind "shift-up:preview-half-page-up" \
|
||||
--bind "shift-down:preview-half-page-down" \
|
||||
--preview "GH_FORCE_TTY=49% gh repo view ''${organization}/{1} | glow -" \
|
||||
--preview-window up
|
||||
)
|
||||
[ -n "''${selected}" ] && {
|
||||
directory="$HOME/dev/work"
|
||||
if [ $organization = "nmasur" ]; then directory="$HOME/dev/personal"; fi
|
||||
repo=$(echo "''${selected}" | awk '{print $1}')
|
||||
repo_full="''${organization}/''${repo}"
|
||||
if [ ! -d "''${directory}/''${repo}" ]; then
|
||||
gh repo clone "$repo_full" "''${directory}/''${repo}"
|
||||
fi
|
||||
echo "''${directory}/''${repo}"
|
||||
}
|
||||
'')
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user