home/home.nix
2023-10-13 17:21:11 +02:00

188 lines
4.9 KiB
Nix

{ pkgs, xdg-runtime-dir, kak-pkg, unispect, ansi-utils, unambig-path }:
let
alacritty = import ./alacritty/alacritty.nix pkgs;
kak = import ./kak.nix { kak = kak-pkg; inherit pkgs; };
extras = import ./extras.nix pkgs;
in rec {
home.username = "xenia";
home.homeDirectory = "/Users/xenia";
home.stateVersion = "23.05";
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
discord-canary
# libreoffice-bin
fira-code ibm-plex
# nix-tree
];
home.sessionVariables = {
XDG_RUNTIME_DIR = xdg-runtime-dir;
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.alacritty = alacritty;
programs.kakoune = kak;
programs.emacs = {
package = pkgs.emacs;
enable = true;
extraPackages = epkgs: with epkgs; [
vterm bind-key rust-mode lsp-mode company meow agda2-mode haskell-mode
terraform-mode nix-mode insert-kaomoji
];
extraConfig = builtins.readFile ./dotfiles/init.el;
};
programs.zsh = {
enable = true;
package = pkgs.zsh;
history = {
path = "${home.homeDirectory}/.zsh_history";
save = 100000000000000;
size = 100000000000000;
extended = true; # Save timestamps
share = true;
};
localVariables = {
TERM = "xterm-256color";
LC_ALL = "en_US.UTF-8";
ARCHFLAGS = "-arch arm64";
RPROMPT = "";
};
# 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 =
''
export PROMPT='$(
BG=172
FG=0
if [ ! -z $NIX_BUILD_CORES ] ; then
BG=56
FG=15
fi
echo -en "%{\033[0m\033[38;5;''${FG}m\033[48;5;''${BG}m%} ";
echo -n "["
${unambig-path}/bin/unambig-path
echo -en "] %T ";
echo -en "%{\033[0m\033[38:5:''${BG}m%}"
echo -en "%{\033[0m%} ";
)'
'' + ''
export EDITOR=${programs.kakoune.package}
''
+ builtins.readFile ./dotfiles/zshrc;
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.hyfetch = {
enable = true;
settings = {
preset = "nonbinary";
mode = "rgb";
color_align = {
mode = "horizontal";
};
};
};
programs.tmux = {
enable = true;
escapeTime = 50;
prefix = "C-]";
shell = "${programs.zsh.package}/bin/zsh";
historyLimit = 30000;
sensibleOnTop = false;
extraConfig =
''
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind left swap-window -d -t -1
bind right swap-window -d -t +1
set-option -sa terminal-overrides ",xterm*:Tc"
# Status bar options
set-option -g status on
set-option -g status-bg colour235
set-option -g status-fg "#FFC757"
set-option -g status-interval 2
set-option -g status-justify "centre"
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 " #[fg=#df73ff bold]!![ #{b:pane_current_path}/ ] #{b:window_index} $ #{b:pane_current_command}!! "
set-window-option -g window-status-format " #{b:window_index} [ #{b:pane_current_path}/ ] #{b:pane_current_command} "
set -g mouse on
set-option -g renumber-windows on # Make windows contiguous
'';
};
programs.git = {
enable = true;
aliases = {
s = "status";
lg = "log --graph --branches --all --decorate --pretty=\"%C(magenta)[%C(red)%an%C(magenta) %ad] %C(yellow)%h: %C(green)%s %C(blue)%N\" --date=short";
};
userName = "xenia";
userEmail = "xenia.agda@gmail.com";
ignores = [ "**/.DS_Store" ];
extraConfig = {
init.defaultBranch = "main";
pull.ff = "only";
pull.rebase = true;
core.editor = "${pkgs.emacs}/bin/emacsclient --create-frame --alternate-editor=''";
};
};
}