init
This commit is contained in:
commit
498f3050d5
145 changed files with 2964 additions and 0 deletions
11
home/terminal/default.nix
Normal file
11
home/terminal/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{config, ...}: let
|
||||
data = config.xdg.dataHome;
|
||||
conf = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
in {
|
||||
imports = [
|
||||
./programs
|
||||
./shell/zsh.nix
|
||||
#./shell/starship.nix
|
||||
];
|
||||
}
|
49
home/terminal/emulator/wezterm.nix
Normal file
49
home/terminal/emulator/wezterm.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
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 = "GitHub Dark"
|
||||
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 = 'v',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
|
||||
},
|
||||
{
|
||||
key = 's',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' },
|
||||
},
|
||||
{
|
||||
key = 'q',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.CloseCurrentPane { confirm = false },
|
||||
},
|
||||
{
|
||||
key = 'f',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.TogglePaneZoomState,
|
||||
},
|
||||
}
|
||||
|
||||
return c
|
||||
'';
|
||||
};
|
||||
}
|
3
home/terminal/programs/comma.nix
Normal file
3
home/terminal/programs/comma.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nix-index-database.comma.enable = true;
|
||||
}
|
8
home/terminal/programs/default.nix
Normal file
8
home/terminal/programs/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./git.nix
|
||||
./direnv.nix
|
||||
./xdg.nix
|
||||
./comma.nix
|
||||
];
|
||||
}
|
7
home/terminal/programs/direnv.nix
Normal file
7
home/terminal/programs/direnv.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
}
|
23
home/terminal/programs/git.nix
Normal file
23
home/terminal/programs/git.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
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";
|
||||
|
||||
userEmail = "xunuwu@gmail.com";
|
||||
userName = "xunuwu";
|
||||
};
|
||||
}
|
26
home/terminal/programs/xdg.nix
Normal file
26
home/terminal/programs/xdg.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
home = config.home.homeDirectory;
|
||||
in {
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
desktop = home + "/desktop";
|
||||
documents = home + "/docs";
|
||||
download = home + "/down";
|
||||
music = home + "/music";
|
||||
pictures = home + "/pics";
|
||||
publicShare = home + "/share";
|
||||
videos = home + "/vids";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [pkgs.xdg-utils];
|
||||
}
|
26
home/terminal/shell/starship.nix
Normal file
26
home/terminal/shell/starship.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{config, ...}: {
|
||||
home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship";
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
};
|
||||
|
||||
git_status = {
|
||||
deleted = "✗";
|
||||
modified = "✶";
|
||||
staged = "✓";
|
||||
stashed = "≡";
|
||||
};
|
||||
|
||||
nix_shell = {
|
||||
symbol = " ";
|
||||
heuristic = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
33
home/terminal/shell/zsh.nix
Normal file
33
home/terminal/shell/zsh.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{config, ...}: {
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autocd = true;
|
||||
enableCompletion = true;
|
||||
enableAutosuggestions = true;
|
||||
dotDir = ".config/zsh";
|
||||
defaultKeymap = "emacs";
|
||||
history = {
|
||||
expireDuplicatesFirst = true;
|
||||
path = "${config.xdg.dataHome}/zsh_history";
|
||||
};
|
||||
initExtra = ''
|
||||
unsetopt beep
|
||||
|
||||
## KEYBINDS ##
|
||||
bindkey "^[[1;5D" backward-word
|
||||
bindkey "^[[1;5C" forward-word
|
||||
WORDCHARS= # this makes ^w actually stop on directory delimiters etc
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Case insensitive completion
|
||||
|
||||
|
||||
## PROMPT ##
|
||||
autoload -Uz vcs_info
|
||||
precmd_vcs_info() { vcs_info }
|
||||
precmd_functions+=( precmd_vcs_info )
|
||||
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