Merge branch 'main' of ssh://codeberg.org/dnscio/nix-config
This commit is contained in:
commit
dc095a1163
12 changed files with 158 additions and 120 deletions
|
|
@ -14,16 +14,6 @@
|
|||
kill_tunnels = /* fish */ ''
|
||||
ps -o pid,command | grep "^[0-9]\{4,5\} ssh -NL" | awk '{print $1}' | xargs kill -9
|
||||
'';
|
||||
fzf = /* fish */ ''
|
||||
set -Ux FZF_DEFAULT_OPTS "
|
||||
--color=fg:#ffffff,bg:#0d0e1c,hl:#ef8386
|
||||
--color=fg+:#ffffff,bg+:#1d2235,hl+:#ef8386
|
||||
--color=border:#61647a,header:#88ca9f,gutter:#0d0e1c
|
||||
--color=spinner:#fec43f,info:#00bcff
|
||||
--color=pointer:#feacd0,marker:#ff5f59,prompt:#9ac8e0"
|
||||
|
||||
command fzf
|
||||
'';
|
||||
dev_projects = /* fish */ ''
|
||||
if test "$hn" = "dnsc-work"
|
||||
begin
|
||||
|
|
@ -38,7 +28,10 @@
|
|||
echo "$HOME/dev/ride/apps/packages";
|
||||
end
|
||||
else
|
||||
fd . ~/dev -t d -d 1
|
||||
begin
|
||||
echo "$HOME/notes"
|
||||
fd . ~/dev -t d -d 1
|
||||
end
|
||||
end
|
||||
'';
|
||||
cdd = /* fish */ ''
|
||||
|
|
@ -66,19 +59,38 @@
|
|||
end
|
||||
end
|
||||
'';
|
||||
_sessionizer_list = /* fish */ ''
|
||||
# Get existing tmux sessions if tmux is running
|
||||
if tmux list-sessions >/dev/null 2>&1
|
||||
tmux list-sessions -F '#{session_name}'
|
||||
end
|
||||
|
||||
# Add development projects
|
||||
dev_projects
|
||||
'';
|
||||
sessionizer = /* fish */ ''
|
||||
set -l selected (dev_projects | fzf --prompt "Create/switch to session: ")
|
||||
set -l selected (_sessionizer_list | fzf --prompt "Create/switch to session: " --header " Ctrl-d: Kill Session " --bind "ctrl-d:execute(tmux kill-session -t basename {})+reload(dev_projects)")
|
||||
|
||||
if test -z "$selected"
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l session_name (basename $selected)
|
||||
set -l tmux_running (pgrep tmux)
|
||||
|
||||
if test $ZELLIJ -eq 0
|
||||
zellij pipe --plugin file:/run/current-system/sw/bin/zellij-switch.wasm -- "--session $session_name --cwd $selected --layout default"
|
||||
else
|
||||
zellij attach "$session_name" --create
|
||||
if test -z $TMUX && test -z $tmux_running
|
||||
tmux new-session -s $session_name -c $selected
|
||||
return 0
|
||||
end
|
||||
|
||||
if not tmux has-session -t=$session_name 2> /dev/null
|
||||
tmux new-session -ds $session_name -c $selected
|
||||
end
|
||||
|
||||
tmux switch-client -t $session_name
|
||||
'';
|
||||
tmux_sessionizer = /* fish */ ''
|
||||
tmux display-popup -h 50% -w 80% -E sessionizer
|
||||
'';
|
||||
nn = /* fish */ ''
|
||||
# Require a title argument
|
||||
|
|
@ -204,9 +216,9 @@
|
|||
# Set some global values
|
||||
set -x GPG_TTY (tty)
|
||||
set hn (prompt_hostname)
|
||||
set fish_cursor_default block blink
|
||||
|
||||
fish_vi_key_bindings insert
|
||||
fish_vi_cursor xterm
|
||||
|
||||
setup_winterly_theme_colors
|
||||
setup_env
|
||||
|
|
@ -219,6 +231,17 @@
|
|||
# Third party integration not covered by
|
||||
# home manager's enableFishIntegration
|
||||
fnm env --use-on-cd --shell fish | source
|
||||
|
||||
# Auto start tmux
|
||||
if status is-interactive; and not set -q TMUX
|
||||
if tmux list-sessions >/dev/null 2>&1
|
||||
# Attach to the first available session
|
||||
tmux attach-session
|
||||
else
|
||||
# Create a new session
|
||||
tmux new-session -t default
|
||||
end
|
||||
end
|
||||
'';
|
||||
|
||||
shellAbbrs = {
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
package = (
|
||||
pkgs.mpv-unwrapped.wrapper {
|
||||
scripts = with pkgs.mpvScripts; [
|
||||
uosc
|
||||
sponsorblock
|
||||
mpris
|
||||
mpv-notify-send
|
||||
];
|
||||
|
||||
mpv = pkgs.mpv-unwrapped.override {
|
||||
waylandSupport = true;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
config = {
|
||||
profile = "high-quality";
|
||||
ytdl-format = "bestvideo+bestaudio";
|
||||
cache-default = 4000000;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
programs.gamemode.enable = true;
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
|
|
|
|||
74
modules/tmux/default.nix
Normal file
74
modules/tmux/default.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
package = pkgs.tmux;
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
disableConfirmationPrompt = true;
|
||||
mouse = true;
|
||||
newSession = true;
|
||||
prefix = "C-b";
|
||||
shell = "${pkgs.fish}/bin/fish";
|
||||
terminal = "screen-256color";
|
||||
keyMode = "vi";
|
||||
escapeTime = 0;
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
plugin = tmuxPlugins.resurrect;
|
||||
extraConfig = ''
|
||||
set -g @resurrect-strategy-nvim 'session'
|
||||
set -g @resurrect-capture-pane-contents 'on'
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = tmuxPlugins.continuum;
|
||||
extraConfig = ''
|
||||
set -g @continuum-restore 'on'
|
||||
set -g @continuum-boot 'on'
|
||||
set -g @continuum-save-interval '10'
|
||||
'';
|
||||
}
|
||||
];
|
||||
extraConfig = ''
|
||||
set -g status-position top
|
||||
set -g status-style bg=#1d202f,fg=white
|
||||
set -g status-left " "
|
||||
set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H "
|
||||
set -g window-status-current-style bg=default,fg=magenta,bold
|
||||
set-window-option -g window-status-format "[#I] #W#F"
|
||||
set-window-option -g window-status-current-format "[#I] #W#F"
|
||||
set -g pane-border-style fg=gray
|
||||
set -g pane-active-border-style fg=magenta
|
||||
|
||||
unbind %
|
||||
bind "|" split-window -h
|
||||
unbind '"'
|
||||
bind - split-window -l 15 -v
|
||||
|
||||
bind r source-file "~/.config/tmux/tmux.conf"
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
bind -r H resize-pane -L 5
|
||||
bind -r J resize-pane -D 5
|
||||
bind -r K resize-pane -U 5
|
||||
bind -r L resize-pane -R 5
|
||||
|
||||
bind ? list-keys -a
|
||||
|
||||
unbind s
|
||||
bind s display-popup -h 50% -w 80% -E sessionizer
|
||||
|
||||
unbind v
|
||||
bind v choose-tree -Zw "join-pane -t '%%'"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -325,53 +325,21 @@ binds {
|
|||
Mod+K { focus-window-or-workspace-up; }
|
||||
Mod+L { focus-column-right; }
|
||||
|
||||
Mod+Ctrl+Left { move-column-left; }
|
||||
Mod+Ctrl+Down { move-window-down; }
|
||||
Mod+Ctrl+Up { move-window-up; }
|
||||
Mod+Ctrl+Right { move-column-right; }
|
||||
Mod+Ctrl+H { move-column-left; }
|
||||
Mod+Ctrl+L { move-column-right; }
|
||||
Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
|
||||
Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
|
||||
Mod+Shift+H { move-column-left; }
|
||||
Mod+Shift+J { move-column-to-workspace-down; }
|
||||
Mod+Shift+K { move-column-to-workspace-up; }
|
||||
Mod+Shift+L { move-column-right; }
|
||||
|
||||
Mod+A { focus-column-first; }
|
||||
Mod+E { focus-column-last; }
|
||||
Mod+Ctrl+A { move-column-to-first; }
|
||||
Mod+Ctrl+E { move-column-to-last; }
|
||||
|
||||
Mod+Shift+Left { focus-monitor-left; }
|
||||
Mod+Shift+Down { focus-monitor-down; }
|
||||
Mod+Shift+Up { focus-monitor-up; }
|
||||
Mod+Shift+Right { focus-monitor-right; }
|
||||
Mod+Shift+H { focus-monitor-left; }
|
||||
Mod+Shift+J { focus-monitor-down; }
|
||||
Mod+Shift+K { focus-monitor-up; }
|
||||
Mod+Shift+L { focus-monitor-right; }
|
||||
|
||||
// Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
|
||||
// Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
|
||||
// Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
|
||||
// Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
|
||||
// Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
||||
// Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
|
||||
// Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
|
||||
// Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
|
||||
// ...
|
||||
// And you can also move a whole workspace to another monitor:
|
||||
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
|
||||
// ...
|
||||
|
||||
Mod+D { focus-workspace-down; }
|
||||
Mod+U { focus-workspace-up; }
|
||||
Mod+Ctrl+D { move-column-to-workspace-down; }
|
||||
Mod+Ctrl+U { move-column-to-workspace-up; }
|
||||
|
||||
// Alternatively, there are commands to move just a single window:
|
||||
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
|
||||
// ...
|
||||
|
||||
Mod+Shift+Page_Down { move-workspace-down; }
|
||||
Mod+Shift+Page_Up { move-workspace-up; }
|
||||
Mod+Shift+U { move-workspace-down; }
|
||||
|
|
|
|||
|
|
@ -12,6 +12,14 @@ keybinds clear-defaults=true {
|
|||
bind "/" { SwitchToMode "Scroll"; }
|
||||
|
||||
// Plugins / Tools
|
||||
bind "q" {
|
||||
LaunchOrFocusPlugin "plugin-manager" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
};
|
||||
SwitchToMode "Locked";
|
||||
}
|
||||
|
||||
bind "w" {
|
||||
LaunchOrFocusPlugin "session-manager" {
|
||||
floating true
|
||||
|
|
@ -306,11 +314,12 @@ plugins {
|
|||
}
|
||||
|
||||
load_plugins {
|
||||
"https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm"
|
||||
}
|
||||
|
||||
simplified_ui false
|
||||
default_mode "locked"
|
||||
default_shell "fish"
|
||||
default_layout "compact"
|
||||
pane_frames true
|
||||
scroll_buffer_size 100000
|
||||
copy_on_select true
|
||||
|
|
@ -320,4 +329,3 @@ session_serialization true
|
|||
pane_viewport_serialization true
|
||||
web_server false
|
||||
show_startup_tips false
|
||||
default_layout "compact"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{ config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
xdg.configFile."zellij/config.kdl" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/zellij/config.kdl";
|
||||
};
|
||||
|
||||
xdg.configFile."zellij/layouts" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/zellij/layouts";
|
||||
};
|
||||
# xdg.configFile."zellij/layouts/default.kdl" = {
|
||||
# source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/zellij/layouts/default.kdl";
|
||||
# };
|
||||
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue