init: added flake.nix and shell home module
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
# Universal shell tools and configuration
|
||||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
name = "${config.home.username}";
|
||||
homeDir = "${config.home.homeDirectory}";
|
||||
myAliases = {
|
||||
ll = "ls -hl";
|
||||
la = "ls -ahl";
|
||||
cl = "clear; ls -hl";
|
||||
cla = "clear; ls -ahl";
|
||||
home-manager = "home-manager -b \"hm-backup\"";
|
||||
home-switch = "home-manager -b \"hm-backup\" switch --flake ~/.dotfiles";
|
||||
gdiff = "git diff HEAD";
|
||||
cdot = "cd ${homeDir}/.dotfiles";
|
||||
cg = "cd $(git rev-parse --show-toplevel)";
|
||||
sudo = "sudo TERMINFO=\"$TERMINFO\"";
|
||||
};
|
||||
in
|
||||
{
|
||||
home = {
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
XDG_CONFIG_HOME = "${homeDir}/.config";
|
||||
DOTFILES = "${homeDir}/.dotfiles";
|
||||
UTILITY = "${homeDir}/.dotfiles/scripts/utility";
|
||||
ZVM_VI_INSERT_ESCAPE_BINDKEY = "jk";
|
||||
};
|
||||
packages = with pkgs; [
|
||||
unzip # decompress files
|
||||
hyfetch # pretty system display tool
|
||||
tree # recursive directory list
|
||||
glow # cli markdown display tool
|
||||
lynx # cli web browser
|
||||
lua5_5 # scripting language
|
||||
htop # system monitor
|
||||
file # identify file type
|
||||
sops # secret management tool
|
||||
];
|
||||
};
|
||||
|
||||
programs = {
|
||||
zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = myAliases;
|
||||
history.size = 10000;
|
||||
setOptions = [ "NO_BEEP" ];
|
||||
plugins = [
|
||||
{
|
||||
name = "vi-mode";
|
||||
src = pkgs.zsh-vi-mode;
|
||||
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
|
||||
}
|
||||
];
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
settings.user = {
|
||||
inherit name;
|
||||
email = config.accounts.email.accounts.${name}.address;
|
||||
};
|
||||
};
|
||||
starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
yazi = {
|
||||
enable = true;
|
||||
shellWrapperName = "y";
|
||||
enableZshIntegration = true;
|
||||
plugins = {
|
||||
git = {
|
||||
package = pkgs.yaziPlugins.git;
|
||||
setup = true;
|
||||
settings = {
|
||||
order = 1500;
|
||||
};
|
||||
};
|
||||
};
|
||||
settings = fromTOML ''
|
||||
[[plugin.prepend_fetchers]]
|
||||
url = "*"
|
||||
run = "git"
|
||||
group = "git"
|
||||
|
||||
[[plugin.prepend_fetchers]]
|
||||
url = "*/"
|
||||
run = "git"
|
||||
group = "git"
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user