some reorganizing
This commit is contained in:
parent
df9e8ae8bf
commit
113e015135
182 changed files with 443 additions and 449 deletions
12
home/profiles/terminal/emulator/foot.nix
Normal file
12
home/profiles/terminal/emulator/foot.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
programs.foot = {
|
||||
enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
# include = "${pkgs.foot.themes}/share/foot/themes/modus-operandi";
|
||||
# font = "monospace:size=9";
|
||||
};
|
||||
mouse.hide-when-typing = true;
|
||||
};
|
||||
};
|
||||
}
|
93
home/profiles/terminal/emulator/wezterm.nix
Normal file
93
home/profiles/terminal/emulator/wezterm.nix
Normal file
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
local wezterm = require'wezterm'
|
||||
local c = {}
|
||||
if wezterm.config_builder then
|
||||
c = wezterm.config_builder()
|
||||
end
|
||||
c.hide_tab_bar_if_only_one_tab = true
|
||||
c.color_scheme = "deep"
|
||||
c.window_padding = { left = 10, right = 10, top = 5, bottom = 5 }
|
||||
c.window_decorations = 'RESIZE'
|
||||
c.window_close_confirmation = "NeverPrompt"
|
||||
c.use_fancy_tab_bar = false
|
||||
|
||||
c.font_size = 9
|
||||
c.adjust_window_size_when_changing_font_size = true
|
||||
|
||||
|
||||
-- Keys
|
||||
c.leader = { key = 'j', mods = 'CTRL', timeout_milliseconds = 1000 }
|
||||
c.keys = {
|
||||
{
|
||||
key = 'q',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.CloseCurrentPane { confirm = false },
|
||||
},
|
||||
{
|
||||
key = 'f',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.TogglePaneZoomState,
|
||||
},
|
||||
{
|
||||
key = 'h',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.ActivatePaneDirection('Left'),
|
||||
},
|
||||
{
|
||||
key = 'j',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.ActivatePaneDirection('Down'),
|
||||
},
|
||||
{
|
||||
key = 'k',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.ActivatePaneDirection('Up'),
|
||||
},
|
||||
{
|
||||
key = 'l',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.ActivatePaneDirection('Right'),
|
||||
},
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitPane { direction = 'Left' },
|
||||
},
|
||||
{
|
||||
key = 'J',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitPane { direction = 'Down' },
|
||||
},
|
||||
{
|
||||
key = 'K',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitPane { direction = 'Up' },
|
||||
},
|
||||
{
|
||||
key = 'L',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitPane { direction = 'Right' },
|
||||
},
|
||||
{
|
||||
key = 's',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.PaneSelect {
|
||||
mode = "Activate"
|
||||
},
|
||||
},
|
||||
{
|
||||
key = ';',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.PaneSelect {
|
||||
mode = "SwapWithActive"
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return c
|
||||
'';
|
||||
};
|
||||
}
|
12
home/profiles/terminal/programs/comma.nix
Normal file
12
home/profiles/terminal/programs/comma.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{inputs, ...}: {
|
||||
imports = [inputs.nix-index-database.hmModules.nix-index];
|
||||
|
||||
programs = {
|
||||
nix-index-database.comma.enable = true;
|
||||
nix-index = {
|
||||
enableBashIntegration = false;
|
||||
enableFishIntegration = false;
|
||||
enableZshIntegration = false;
|
||||
};
|
||||
};
|
||||
}
|
7
home/profiles/terminal/programs/direnv.nix
Normal file
7
home/profiles/terminal/programs/direnv.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
28
home/profiles/terminal/programs/git.nix
Normal file
28
home/profiles/terminal/programs/git.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
delta.enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
ignores = ["*~" ".direnv"];
|
||||
|
||||
signing = {
|
||||
key = "${config.home.homeDirectory}/.ssh/id_ed25519";
|
||||
signByDefault = true;
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
gpg.format = "ssh";
|
||||
push.autoSetupRemote = true;
|
||||
pull.rebase = true;
|
||||
rebase.autostash = true;
|
||||
};
|
||||
|
||||
userEmail = "xunuwu@gmail.com";
|
||||
userName = "xunuwu";
|
||||
};
|
||||
}
|
4
home/profiles/terminal/programs/github.nix
Normal file
4
home/profiles/terminal/programs/github.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
programs.gh.enable = true;
|
||||
programs.gh-dash.enable = true;
|
||||
}
|
22
home/profiles/terminal/programs/irssi.nix
Normal file
22
home/profiles/terminal/programs/irssi.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{pkgs, ...}: {
|
||||
programs.irssi = {
|
||||
enable = true;
|
||||
networks = {
|
||||
liberachat = {
|
||||
nick = "wheat";
|
||||
server = {
|
||||
address = "irc.libera.chat";
|
||||
port = 6697;
|
||||
autoConnect = true;
|
||||
};
|
||||
channels = {
|
||||
nixos.autoJoin = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
home.file.".irssi/default.theme".source = pkgs.fetchurl {
|
||||
url = "https://irssi-import.github.io/themes/h3rbz.theme";
|
||||
hash = "sha256-2nB+jvDXPgkMXTd6f305R2aBt/D4kbsIGbqcIllHADo=";
|
||||
};
|
||||
}
|
3
home/profiles/terminal/programs/lazygit.nix
Normal file
3
home/profiles/terminal/programs/lazygit.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.lazygit.enable = true;
|
||||
}
|
3
home/profiles/terminal/programs/tdf.nix
Normal file
3
home/profiles/terminal/programs/tdf.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [tdf];
|
||||
}
|
24
home/profiles/terminal/programs/tmux.nix
Normal file
24
home/profiles/terminal/programs/tmux.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
mouse = true;
|
||||
escapeTime = 0;
|
||||
extraConfig = ''
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
bind c new-window -c "#{pane_current_path}";
|
||||
|
||||
set -g status-style bg=default
|
||||
setw -g window-status-current-style fg=#be95ff
|
||||
set -g status-justify absolute-centre
|
||||
set -g status-interval 5
|
||||
set -g status-right "#[fg=#25be6a]#(free -h | awk 'NR==2{print $3\"/\"$2}')"
|
||||
set -ag status-right "#[fg=default] %a %d %b %H:%M"
|
||||
|
||||
set-option -g default-terminal "xterm-256color"
|
||||
set-option -ga terminal-overrides ",xterm-256color:Tc"
|
||||
'';
|
||||
};
|
||||
}
|
29
home/profiles/terminal/programs/xdg.nix
Normal file
29
home/profiles/terminal/programs/xdg.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
# TODO: move this somewhere more reasonable
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
home = config.home.homeDirectory;
|
||||
in {
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
desktop = home + "/desktop";
|
||||
documents = home + "/docs";
|
||||
download = home + "/down";
|
||||
music = home + "/music";
|
||||
pictures = home + "/pics";
|
||||
publicShare = home + "/share";
|
||||
videos = home + "/vids";
|
||||
extraConfig = {
|
||||
XDG_SCREENSHOTS_DIR = config.xdg.userDirs.pictures + "/screenshots";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [pkgs.xdg-utils];
|
||||
}
|
3
home/profiles/terminal/programs/zoxide.nix
Normal file
3
home/profiles/terminal/programs/zoxide.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.zoxide.enable = true;
|
||||
}
|
73
home/profiles/terminal/shell/zsh.nix
Normal file
73
home/profiles/terminal/shell/zsh.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
{config, ...}: {
|
||||
programs.fzf.enable = true;
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
dotDir = ".config/zsh";
|
||||
defaultKeymap = "emacs";
|
||||
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
extended = true;
|
||||
save = 100 * 1000;
|
||||
path = "${config.xdg.dataHome}/zsh_history";
|
||||
};
|
||||
initExtra = ''
|
||||
unsetopt beep
|
||||
|
||||
## KEYBINDS ##
|
||||
bindkey "^[[1;5D" backward-word
|
||||
bindkey "^[[1;5C" forward-word
|
||||
|
||||
# improve ^w behaviour
|
||||
WORDCHARS=
|
||||
|
||||
# pretty completion menu
|
||||
zstyle ':completion:*' menu select
|
||||
|
||||
# shift-tab in completion menu
|
||||
bindkey '^[[Z' reverse-menu-complete
|
||||
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Case insensitive completion
|
||||
|
||||
|
||||
## MISC ##
|
||||
setopt extendedglob
|
||||
|
||||
|
||||
# Show completion categories
|
||||
zstyle ':completion:*:*:*:*:descriptions' format '%F{magenta}<-%d->%f'
|
||||
|
||||
|
||||
## PROMPT ##
|
||||
function preexec() {
|
||||
timer=$(date +%s%3N)
|
||||
}
|
||||
|
||||
function precmd_timer() {
|
||||
if [ $timer ]; then
|
||||
now=$(date +%s%3N)
|
||||
elapsed=$(($now-$timer))
|
||||
|
||||
if [[ elapsed -gt 100 ]]; then
|
||||
export RPROMPT="%F{cyan}''${elapsed}ms %f"
|
||||
else
|
||||
unset RPROMPT
|
||||
fi
|
||||
unset timer
|
||||
fi
|
||||
}
|
||||
|
||||
autoload -Uz vcs_info
|
||||
precmd_vcs_info() { vcs_info }
|
||||
precmd_functions+=( precmd_vcs_info precmd_timer )
|
||||
zstyle ':vcs_info:git:*' formats ' %b '
|
||||
setopt prompt_subst
|
||||
|
||||
PROMPT='%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f '
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue