2023-10-19 00:21:53 +02:00
{ pkgs , username , home-dir , prompt-color , xdg-runtime-dir , kak-pkg , unispect , ansi-utils , unambig-path }:
2023-10-12 22:51:18 +02:00
let
kak = import ./kak.nix { kak = kak-pkg ; inherit pkgs ; } ;
extras = import ./extras.nix pkgs ;
in rec {
2023-10-19 00:18:10 +02:00
home . username = username ;
home . homeDirectory = home-dir ;
2023-10-12 22:51:18 +02:00
home . stateVersion = " 2 3 . 0 5 " ;
home . packages = with pkgs ; extras . all ++ [
# Input packages
unispect
ansi-utils . ansicols
ansi-utils . ansimove
unambig-path
# # Terminal utilities
ripgrep fd bat
watchexec unixtools . watch
htop
fzf
pv
binwalk
ffmpeg yt-dlp
nmap
blahaj
# Programming languages
jq
rink
ghc
( python310 . withPackages ( ps : with ps ; [
ipython numpy matplotlib sympy scipy pwntools z3 tqdm pwntools mypy # (pylsp-mypy.overrideAttrs (old: { doCheck = false; }))
( extras . challtools ps )
] ) )
( agda . withPackages ( ps : with ps ; [ standard-library cubical ] ) )
# jupyter
# nodePackages.typescript
# nodePackages.typescript-language-server
# rust-analyzer
# # Other stuff
kak-lsp
# nix-tree
] ;
home . sessionVariables = {
XDG_RUNTIME_DIR = xdg-runtime-dir ;
} ;
# Let Home Manager install and manage itself.
programs . home-manager . enable = true ;
programs . kakoune = kak ;
programs . zsh = {
enable = true ;
package = pkgs . zsh ;
history = {
path = " ${ home . homeDirectory } / . z s h _ h i s t o r y " ;
save = 100000000000000 ;
size = 100000000000000 ;
extended = true ; # Save timestamps
share = true ;
} ;
localVariables = {
TERM = " x t e r m - 2 5 6 c o l o r " ;
LC_ALL = " e n _ U S . U T F - 8 " ;
ARCHFLAGS = " - a r c h a r m 6 4 " ;
RPROMPT = " " ;
2023-10-19 00:21:53 +02:00
PROMPT_COLOR = prompt-color ;
2023-10-12 22:51:18 +02:00
} ;
# We put PROMPT in initExtra instead of localVariables.PROMPT because nix puts the string in double quotes, whereas we want single quotes for the command to run each time
initExtra =
''
2023-10-19 14:22:30 +02:00
get_stuff_in_nix ( ) {
printf " % s " $ PATH | tr ' : ' ' \ n' | grep ' /nix/store ' \
| sed - Ee ' s | /nix/store / [ 0 - 9 a-z ] * - ( . * ) /. * | \ 1 | g' \
| sed - Ee ' s | - [ 0 -9 ] + ( \ . [ 0 -9 ] + ) + || g' \
| tr ' \ n' ' '
}
2023-10-12 22:51:18 +02:00
export PROMPT = ' $ (
2023-10-19 00:21:53 +02:00
BG = $ PROMPT_COLOR
2023-10-12 22:51:18 +02:00
FG = 0
2023-10-19 14:22:30 +02:00
NIX_CONTENT = " $ ( g e t _ s t u f f _ i n _ n i x ) "
if [ ! - z " $ N I X _ B U I L D _ C O R E S " - o ! - z " $ N I X _ C O N T E N T " ] ; then
2023-10-12 22:51:18 +02:00
BG = 56
FG = 15
fi
echo - en " % { \0 3 3 [ 0 m \0 3 3 [ 3 8 ; 5 ; ' ' ${ FG } m \0 3 3 [ 4 8 ; 5 ; ' ' ${ BG } m % } " ;
echo - n " [ "
$ { unambig-path } /bin/unambig-path
2023-10-19 14:22:30 +02:00
echo - en " ] $ N I X _ C O N T E N T % T " ;
2023-10-12 22:51:18 +02:00
echo - en " % { \0 3 3 [ 0 m \0 3 3 [ 3 8 : 5 : ' ' ${ BG } m % } "
echo - en " % { \0 3 3 [ 0 m % } " ;
) '
''
+ builtins . readFile ./dotfiles/zshrc ;
} ;
programs . direnv = {
enable = true ;
enableZshIntegration = true ;
nix-direnv . enable = true ;
} ;
2023-10-13 17:21:11 +02:00
programs . hyfetch = {
enable = true ;
settings = {
preset = " n o n b i n a r y " ;
mode = " r g b " ;
color_align = {
mode = " h o r i z o n t a l " ;
} ;
} ;
} ;
2023-10-12 22:51:18 +02:00
programs . tmux = {
enable = true ;
escapeTime = 50 ;
prefix = " C - ] " ;
shell = " ${ programs . zsh . package } / b i n / z s h " ;
historyLimit = 30000 ;
sensibleOnTop = false ;
extraConfig =
''
bind ' " ' s p l i t - w i n d o w - c " #{pane_current_path}"
bind % split-window - h - c " # { p a n e _ c u r r e n t _ p a t h } "
bind c new-window - c " # { p a n e _ c u r r e n t _ p a t h } "
bind left swap-window - d - t -1
bind right swap-window - d - t + 1
set-option - sa terminal-overrides " , x t e r m * : T c "
# Status bar options
set-option - g status on
set-option - g status-bg colour235
set-option - g status-fg " # F F C 7 5 7 "
set-option - g status-interval 2
set-option - g status-justify " c e n t r e "
set-option - g status-left-length 60
set-option - g status-left " [ # S ] "
set-option - g status-right " : 3 "
set-option - g status-right-length 90
set - g status-interval 1
set-window-option - g window-status-separator " - "
set-window-option - g window-status-current-format " # [ f g = # d f 7 3 f f b o l d ] ! ! [ # { b : p a n e _ c u r r e n t _ p a t h } / ] # { b : w i n d o w _ i n d e x } $ # { b : p a n e _ c u r r e n t _ c o m m a n d } ! ! "
set-window-option - g window-status-format " # { b : w i n d o w _ i n d e x } [ # { b : p a n e _ c u r r e n t _ p a t h } / ] # { b : p a n e _ c u r r e n t _ c o m m a n d } "
set - g mouse on
set-option - g renumber-windows on # Make windows contiguous
'' ;
} ;
programs . git = {
enable = true ;
aliases = {
s = " s t a t u s " ;
lg = " l o g - - g r a p h - - b r a n c h e s - - a l l - - d e c o r a t e - - p r e t t y = \" % C ( m a g e n t a ) [ % C ( r e d ) % a n % C ( m a g e n t a ) % a d ] % C ( y e l l o w ) % h : % C ( g r e e n ) % s % C ( b l u e ) % N \" - - d a t e = s h o r t " ;
} ;
userName = " x e n i a " ;
userEmail = " x e n i a . a g d a @ g m a i l . c o m " ;
ignores = [ " * * / . D S _ S t o r e " ] ;
extraConfig = {
init . defaultBranch = " m a i n " ;
pull . ff = " o n l y " ;
pull . rebase = true ;
core . editor = " ${ pkgs . emacs } / b i n / e m a c s c l i e n t - - c r e a t e - f r a m e - - a l t e r n a t e - e d i t o r = ' ' " ;
} ;
} ;
}