2023-08-05 19:31:10 -06:00
|
|
|
{ config, pkgs, options, lib, inputs, ... }:
|
2023-08-19 22:54:14 -06:00
|
|
|
let libDir = "${config.dotfiles-directory}/dotfiles/lib";
|
|
|
|
in
|
2021-08-02 03:13:44 -06:00
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
dotfiles-directory = mkOption {
|
2023-06-28 22:46:04 -06:00
|
|
|
type = types.path;
|
2023-06-28 22:39:07 -06:00
|
|
|
default = ../.;
|
2021-08-02 03:13:44 -06:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-08-19 22:54:14 -06:00
|
|
|
config = {
|
2021-08-02 03:13:44 -06:00
|
|
|
# Shell configuration
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
syntaxHighlighting = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
ohMyZsh = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ "git" "sudo" "pip" ];
|
|
|
|
};
|
|
|
|
shellInit = ''
|
|
|
|
fpath+="${libDir}/functions"
|
|
|
|
for file in "${libDir}/functions/"*
|
|
|
|
do
|
|
|
|
autoload "''${file##*/}"
|
|
|
|
done
|
2024-04-28 17:16:28 -06:00
|
|
|
fpath+="${pkgs.python-with-my-packages}/lib/python3.11/site-packages/argcomplete/bash_completion.d"
|
2021-08-02 03:13:44 -06:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-08-05 19:06:57 -06:00
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
2023-08-28 20:07:21 -06:00
|
|
|
interactiveOnly = true;
|
2023-08-04 00:49:34 -06:00
|
|
|
settings = {
|
|
|
|
add_newline = false;
|
|
|
|
character = {
|
|
|
|
success_symbol = "[➜](bold green)";
|
|
|
|
error_symbol = "[➜](bold red)";
|
|
|
|
};
|
|
|
|
};
|
2021-08-05 19:06:57 -06:00
|
|
|
};
|
|
|
|
|
2021-08-02 03:13:44 -06:00
|
|
|
environment = {
|
|
|
|
homeBinInPath = true;
|
|
|
|
localBinInPath = true;
|
2021-08-21 17:39:43 -06:00
|
|
|
shellAliases = {
|
|
|
|
df_ssh = "TERM='xterm-256color ssh -o StrictHostKeyChecking=no'";
|
2024-03-11 20:43:55 -06:00
|
|
|
fix_nix = "LD_LIBRARY_PATH='' nix";
|
2021-08-21 17:39:43 -06:00
|
|
|
};
|
2023-08-05 19:31:10 -06:00
|
|
|
variables = {
|
|
|
|
ROFI_SYSTEMD_TERM = "alacritty -e";
|
|
|
|
NIXPKGS_GIT_REV = "${inputs.nixpkgs.rev}";
|
|
|
|
NIXPKGS_SOURCE = "${inputs.nixpkgs.outPath}";
|
2023-08-23 00:11:27 -06:00
|
|
|
EDITOR = "emacsclient --alternate-editor emacs";
|
2023-08-05 19:31:10 -06:00
|
|
|
};
|
2021-08-05 19:06:57 -06:00
|
|
|
interactiveShellInit = ''
|
2021-08-21 17:39:43 -06:00
|
|
|
vterm_printf(){
|
2021-08-05 19:06:57 -06:00
|
|
|
if [ -n "$TMUX" ] && ([ "''${TERM%%-*}" = "tmux" ] || [ "''${TERM%%-*}" = "screen" ] ); then
|
|
|
|
# Tell tmux to pass the escape sequences through
|
|
|
|
printf "\ePtmux;\e\e]%s\007\e\\" "$1"
|
|
|
|
elif [ "''${TERM%%-*}" = "screen" ]; then
|
|
|
|
# GNU screen (screen, screen-256color, screen-256color-bce)
|
|
|
|
printf "\eP\e]%s\007\e\\" "$1"
|
|
|
|
else
|
|
|
|
printf "\e]%s\e\\" "$1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
|
|
|
|
&& [[ -n ''${EMACS_VTERM_PATH} ]] \
|
|
|
|
&& [[ -f ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
|
2023-08-20 13:00:17 -06:00
|
|
|
source ''${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
|
2021-08-05 19:06:57 -06:00
|
|
|
fi
|
|
|
|
export STARSHIP_INSIDE_EMACS="yes"
|
|
|
|
'';
|
2021-08-02 03:13:44 -06:00
|
|
|
extraInit = ''
|
2023-08-05 19:31:10 -06:00
|
|
|
export PATH="$HOME/.cargo/bin:${libDir}/bin:${libDir}/functions:$PATH";
|
2021-08-02 03:13:44 -06:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|