nixos/home/common.nix
2026-05-23 00:31:58 +01:00

166 lines
4.2 KiB
Nix

{
config,
pkgs,
lazyvim,
...
}:
{
home.sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
BROWSER = "brave";
};
imports = [ lazyvim.homeManagerModules.default ];
programs = {
mpv = {
enable = true;
package = pkgs.mpv.override {
scripts = with pkgs.mpvScripts; [
sponsorblock
];
};
config = {
profile = "high-quality";
ytdl-format = "bestvideo+bestaudio";
cache-default = 4000000;
loop-file = "inf";
};
extraInput = ''
r cycle_values video-rotate 90 180 270 0
'';
};
lazyvim = {
enable = true;
plugins = {
colorscheme = ''
return {
"kepano/flexoki-neovim"
}
'';
};
};
# neovim = {
# enable = true;
# viAlias = true;
# vimAlias = true;
# plugins = [
# pkgs.vimPlugins.LazyVim
# {
# plugin = pkgs.vimPlugins.LazyVim;
# }
# ];
# extraConfig = ''
# set nocompatible
# syntax on
# set fileformat=unix
# set encoding=utf8
# set number relativenumber
# set wrap
# set tabstop=4
# set shiftwidth=4
# set softtabstop=4
# set smarttab
# set autoindent
# set colorcolumn=80
# highlight ColorColumn ctermbg=8
# set clipboard=unnamed,unnamedplus
# set list listchars=tab:>-,trail:_,extends:>,precedes:<,nbsp:~
# set showbreak=>
# let mapleader=" "
# "# disable macro mode
# map q <Nop>
# '';
# };
tmux = {
enable = true;
historyLimit = 10000;
mouse = true;
extraConfig = ''
# Status bar
set -g status-position top
set -g status-interval 5
set -g status-left-length 30
set -g status-right-length 50
set -g window-status-separator ""
set -gw automatic-rename on
set -gw automatic-rename-format '#{b:pane_current_path}'
# theme
set -g status-style "bg=default,fg=default"
set -g status-left "#[fg=black,bg=blue,bold] #S #[bg=default] "
set -g status-right "#[fg=blue]#{?pane_in_mode,COPY ,}#{?client_prefix,PREFIX ,}#{?window_zoomed_flag,ZOOM ,}#[fg=brightblack]#h "
set -g window-status-format "#[fg=brightblack] #I:#W "
set -g window-status-current-format "#[fg=blue,bold] #I:#W "
set -g pane-border-style "fg=brightblack"
set -g pane-active-border-style "fg=blue"
set -g message-style "bg=default,fg=blue"
set -g message-command-style "bg=default,fg=blue"
set -g mode-style "bg=blue,fg=black"
setw -g clock-mode-colour blue
'';
};
fzf = {
enable = true;
enableZshIntegration = true;
};
zsh = {
enable = true;
dotDir = "${config.xdg.configHome}/zsh";
syntaxHighlighting.enable = true;
initContent = ''
bindkey -v
export KEYTIMEOUT=1
# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char
# Change cursor shape for different vi modes.
function zle-keymap-select () {
case $KEYMAP in
vicmd) echo -ne '\e[1 q';; # block
viins|main) echo -ne '\e[5 q';; # beam
esac
}
zle -N zle-keymap-select
zle-line-init() {
zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
echo -ne "\e[5 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
'';
oh-my-zsh = {
enable = true;
plugins = [ "git" ];
theme = "daveverwer";
};
};
git = {
enable = true;
settings.user.Name = "Faris";
settings.user.email = "faris@mektem.com";
};
};
}