feat: Dump of updates

This commit is contained in:
Glen Goodwin 2023-06-19 02:58:07 -04:00
parent 81504a006e
commit e6c53843b4
12 changed files with 274 additions and 35 deletions

View file

@ -1,9 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
# https://devenv.sh/basics/
env.GREET = "devenv";
# https://devenv.sh/packages/ # https://devenv.sh/packages/
packages = [ pkgs.git ]; packages = [ pkgs.git ];

54
flake.lock generated
View file

@ -10,11 +10,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1686054274, "lastModified": 1686642933,
"narHash": "sha256-93aebyN7EMmeFFXisFIvp28UEbrozu79vd3pKPjvNR0=", "narHash": "sha256-5Z4uitx27QtZIrG9sOSJlZRNcVQn/TI36nj7o70n5Dw=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "c51a56bac8853c019241fe8d821c0a0d82422835", "rev": "f5278b5d56e39f86a299a2e1889906933a26f762",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -84,11 +84,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1685395684, "lastModified": 1686666715,
"narHash": "sha256-XUUWE5XJiGZ2Wi+Mxv/mIwKYDPEC8gYHkHyT3+/sciY=", "narHash": "sha256-lBYoA/AI22znVdwuRd1yFwixeAT9m0oudP4TVdhJiC0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "43ed7048f670661d1ae2ea0d2f7655e87e7b0461", "rev": "e4aa9fd83b5c2d43b3c9c9de979a8675fcb8e563",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -107,11 +107,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1685380658, "lastModified": 1686680001,
"narHash": "sha256-LPih0Q//p8IurXG9kGRVGAqV4AUKVYj9xkk3sYYAj6I=", "narHash": "sha256-JPcudWZ2bBwkJofGTV23NyXw/wo7PyiLFIdqPfrzxHE=",
"owner": "vaxerski", "owner": "vaxerski",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "51a930f802c71a0e67f05e7b176ded74e8e95f87", "rev": "7762ac0173b860af83e58d56409f9cf0fa7252e9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -128,11 +128,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1681065697, "lastModified": 1684265364,
"narHash": "sha256-QPzwwlGKX95tl6ZEshboZbEwwAXww6lNLdVYd6T9Mrc=", "narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "4d29e48433270a2af06b8bc711ca1fe5109746cd", "rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -183,11 +183,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1685290091, "lastModified": 1686501370,
"narHash": "sha256-GGQYNZ7POoqPTtXgPOLUuSiHkOKFRWYpCoWUOSeSRoU=", "narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4e37b4e55b60fb7d43d2b62deb51032a489bcbe8", "rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -231,11 +231,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1685347552, "lastModified": 1686582075,
"narHash": "sha256-9woSppRyUFo26yUffORTzttJ+apOt8MmCv6RxpPNTU4=", "narHash": "sha256-vtflsfKkHtF8IduxDNtbme4cojiqvlvjp5QNYhvoHXc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f2f1ec390714d303cf84ba086e34e45b450dd8c4", "rev": "7e63eed145566cca98158613f3700515b4009ce3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -260,11 +260,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1682596858, "lastModified": 1686050334,
"narHash": "sha256-Hf9XVpqaGqe/4oDGr30W8HlsWvJXtMsEPHDqHZA6dDg=", "narHash": "sha256-R0mczWjDzBpIvM3XXhO908X5e2CQqjyh/gFbwZk/7/Q=",
"owner": "cachix", "owner": "cachix",
"repo": "pre-commit-hooks.nix", "repo": "pre-commit-hooks.nix",
"rev": "fb58866e20af98779017134319b5663b8215d912", "rev": "6881eb2ae5d8a3516e34714e7a90d9d95914c4dc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -286,11 +286,11 @@
"flake": false, "flake": false,
"locked": { "locked": {
"host": "gitlab.freedesktop.org", "host": "gitlab.freedesktop.org",
"lastModified": 1682436395, "lastModified": 1686573751,
"narHash": "sha256-GGEjkQO9m7YLYIXIXM76HWdhjg4Ye+oafOtyaFAYKI4=", "narHash": "sha256-5vnFxEMvn4wzT+XKR5Jo8VSn1hXrdf/mWuTmdHhRFBs=",
"owner": "wlroots", "owner": "wlroots",
"repo": "wlroots", "repo": "wlroots",
"rev": "6830bfc17fd94709e2cdd4da0af989f102a26e59", "rev": "6e8fb5509f2c94d09d4efa0f9b1f40b37bf73863",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -312,11 +312,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1682439384, "lastModified": 1685385764,
"narHash": "sha256-zHDa8LCZs05TZHQSIZ3ucwyMPglBGHcqTBzfkLjYXTM=", "narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "c0e233955568fbea4e859336f6d3d14d51294d7c", "rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -71,6 +71,7 @@
pciutils pciutils
usbutils usbutils
wget wget
lsof
]; ];
}; };
@ -95,6 +96,7 @@
}; };
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
wireplumber.enable = true;
}; };
# Open ports in the firewall. # Open ports in the firewall.

View file

@ -6,6 +6,7 @@
[ (import ../modules/programs/wofi.nix) ] ++ [ (import ../modules/programs/wofi.nix) ] ++
[ (import ../modules/editors/nvim/home.nix) ] ++ [ (import ../modules/editors/nvim/home.nix) ] ++
[ (import ../modules/programs/devenv/home.nix) ] ++ [ (import ../modules/programs/devenv/home.nix) ] ++
[ (import ../modules/shell/tmux/home.nix) ] ++
[ (import ../modules/shell/zsh/home.nix) ]; [ (import ../modules/shell/zsh/home.nix) ];
home = { home = {
@ -15,7 +16,7 @@
packages = with pkgs; [ packages = with pkgs; [
# Terminal # Terminal
btop # Resource Manager htop
nitch # Minimal fetch nitch # Minimal fetch
tldr # Helper tldr # Helper
zellij # multiplexer zellij # multiplexer
@ -38,6 +39,17 @@
dbeaver dbeaver
ansible ansible
nixpkgs-fmt nixpkgs-fmt
zoxide
webcord
nfs-utils
keychain
slides
glow
entr
just
bandwhich
navi
git-crypt

View file

@ -16,6 +16,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
docker-compose docker-compose
distrobox distrobox
kind
]; ];
} }

View file

@ -26,7 +26,7 @@
nvim-lspconfig nvim-lspconfig
nvim-tree-lua nvim-tree-lua
nvim-ts-rainbow nvim-ts-rainbow
(nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) nvim-treesitter.withAllGrammars
plenary-nvim plenary-nvim
telescope-fzy-native-nvim telescope-fzy-native-nvim
telescope-nvim telescope-nvim

View file

@ -26,8 +26,7 @@
background-color: rgba(80,100,100,0.4); background-color: rgba(80,100,100,0.4);
} }
window#waybar { window#waybar {
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.8);
background: transparent;
transition-property: background-color; transition-property: background-color;
transition-duration: .5s; transition-duration: .5s;
border-bottom: none; border-bottom: none;

View file

@ -11,6 +11,15 @@
}; };
}; };
programs.zsh = {
shellAliases = {
trackme = "git branch --set-upstream-to=origin/$(git symbolic-ref --short HEAD)";
rebasemain = "git pull origin main --rebase";
};
};
home.packages = with pkgs; [ home.packages = with pkgs; [
cocogitto cocogitto
lazygit lazygit

141
modules/shell/tmux/home.nix Normal file
View file

@ -0,0 +1,141 @@
{ pkgs, config, ... }:
{
programs.tmux = {
enable = true;
clock24 = true;
plugins = with pkgs.tmuxPlugins; [
sensible
yank
{
plugin = power-theme;
extraConfig = ''
set -g @tmux_power_theme 'sky'
'';
}
resurrect
continuum
];
extraConfig = ''
bind -n M-r source-file ~/.config/tmux/tmux.conf
set -g mouse on
set-option -g status-position top
bind-key g display-popup -h 95% -w 95% -E 'lazygit'
bind-key t display-popup -h 95% -w 95% -E "${pkgs.htop}/bin/htop"
bind C-g display-popup -E "tat ~/gallery"
bind -n M-g display-popup -E "tmux new-session -A -s scratch"
bind -n M-b switch-client -l
bind -n M-p previous-window
bind -n M-n next-window
bind -n M-P switch-client -p
bind -n M-N switch-client -n
unbind f
bind f resize-pane -Z
# create session
bind C-c new-session
# split current window horizontally
bind - split-window -v
# split current window vertically
bind _ split-window -h
# Select Layouts
#―――――――――――――――――
bind -n M-a select-layout main-vertical
bind -n M-A select-layout main-horizontal
bind -n M-E select-layout even-vertical
bind -n M-V select-layout even-horizontal
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
bind -r c-f resize-pane -Z
# window navigation
unbind n
unbind p
setw -g mode-keys vi
bind Enter copy-mode # enter copy mode
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
# -- buffers -------------------------------------------------------------------
bind b list-buffers # list paste buffers
bind p paste-buffer -p # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
# -- display -------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
set -g renumber-windows on # renumber windows when a window is closed
bind k display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
fzf --reverse -m --header=kill-session |\
xargs -I {} tmux kill-session -t {}"
bind C-j display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
sed '/^$/d' |\
fzf --reverse --header jump-to-session --preview 'tmux capture-pane -pt {}' |\
xargs tmux switch-client -t"
'';
};
programs.tmate = {
enable = true;
};
home.packages = [
# Open tmux for current project.
(pkgs.writeShellApplication {
name = "tat";
runtimeInputs = [ pkgs.tmux pkgs.fzf ];
text = builtins.readFile ./ta.sh;
})
pkgs.fzf
];
programs.zsh = {
shellAliases = {
tx = "tmux new -s default";
ta = "tmux attach -t";
tad = "tmux attach -d -t";
ts = "tmux new-session -s";
tl = "tmux list-sessions";
tksv = "tmux kill-server";
tkss = "tmux kill-session -t";
};
};
}

77
modules/shell/tmux/ta.sh Normal file
View file

@ -0,0 +1,77 @@
#!/bin/bash
not_in_tmux() {
[ -z "$TMUX" ]
}
DIR="$1"
# If no arguments are passed in, try to immediately attach or start without further input
echo "$DIR"
if [ -z "$DIR" ]; then
if not_in_tmux; then
tmux attach && exit 1 || DIR="--start"
else
exit 1
fi
fi
# If --start was passed in, immediately start a new session based on the current directory
if [ "$DIR" = "--start" ]; then
echo "Starting"
path_name="$(basename "$PWD" | tr . -)"
session_name="${path_name//./_}"
else
# Ask the user which directory to start in
_session_name=$(cd "$DIR" && find -L . -maxdepth 1 -type d -printf "%f\n" | sed "s|/||g" | fzf --reverse --header="Select project from $(basename "$DIR") >")
session_name="${_session_name//./_}"
path_name="$DIR/$_session_name"
fi
echo "Session name is \"$session_name\""
echo "Path name is \"$path_name\""
if [ -z "$session_name" ]; then
# Operation cancelled by user
exit 1
fi
session_exists() {
# Check if the $session_name exists
tmux has-session -t "=$session_name"
}
create_detached_session() {
if [ "$DIR" = "--start" ]; then
(TMUX=''
tmux new-session -Ad -s "$session_name" -c "$path_name"
)
else
(TMUX=''
tmux new-session -Ad -s "$session_name" -c "$path_name"
tmux split-window -vb -t "$session_name" -c "$path_name" -p 70
tmux send-keys -t "$session_name" "nvim '+Telescope find_files'" Enter
)
fi
}
create_if_needed_and_attach() {
if not_in_tmux; then
tmux new-session -As "$session_name" -c "$path_name"
else
if ! session_exists; then
create_detached_session
fi
tmux switch-client -t "$session_name"
fi
}
attach_to_first_session() {
first_session_name=$(tmux list-sessions -F "#{session_name}" | head -n 1)
if [ -n "$first_session_name" ]; then
tmux attach -t "$first_session_name"
tmux choose-tree -Za
fi
}
create_if_needed_and_attach || attach_to_first_session

View file

@ -22,7 +22,7 @@
# Hook direnv # Hook direnv
#emulate zsh -c "$(direnv hook zsh)" #emulate zsh -c "$(direnv hook zsh)"
# Swag # Swag
${pkgs.nitch}/bin/nitch #${pkgs.nitch}/bin/nitch
#eval "$(direnv hook zsh)" #eval "$(direnv hook zsh)"
eval "$(atuin init zsh)" eval "$(atuin init zsh)"

View file

@ -4,6 +4,7 @@
enable = true; enable = true;
shellAliases = { shellAliases = {
update = "sudo nixos-rebuild switch"; update = "sudo nixos-rebuild switch";
clean = "nix-collect-garbage -d";
reload = "source ~/.zshrc"; reload = "source ~/.zshrc";
"." = "cd ../"; "." = "cd ../";