2023-11-06 07:18:06 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2023-09-15 07:13:52 +01:00
|
|
|
|
|
|
|
{
|
2023-11-12 14:13:03 +00:00
|
|
|
stylix.targets = {
|
|
|
|
avizo.enable = true;
|
|
|
|
fzf.enable = true;
|
|
|
|
mako.enable = true;
|
|
|
|
tmux.enable = true;
|
|
|
|
xresources.enable = true;
|
|
|
|
};
|
|
|
|
xdg.configFile = {
|
|
|
|
"style.css".text = with config.lib.stylix.colors.withHashtag; ''
|
|
|
|
@define-color base00 ${base00};
|
|
|
|
@define-color base01 ${base01};
|
|
|
|
@define-color base02 ${base02};
|
|
|
|
@define-color base03 ${base03};
|
|
|
|
@define-color base04 ${base04};
|
|
|
|
@define-color base05 ${base05};
|
|
|
|
@define-color base06 ${base06};
|
|
|
|
@define-color base07 ${base07};
|
|
|
|
@define-color base08 ${base08};
|
|
|
|
@define-color base09 ${base09};
|
|
|
|
@define-color base0A ${base0A};
|
|
|
|
@define-color base0B ${base0B};
|
|
|
|
@define-color base0C ${base0C};
|
|
|
|
@define-color base0D ${base0D};
|
|
|
|
@define-color base0E ${base0E};
|
|
|
|
@define-color base0F ${base0F};
|
|
|
|
'';
|
|
|
|
"bat/themes/tokyonight_night.tmTheme".source = ./tokyonight_night.tmTheme;
|
|
|
|
};
|
2023-09-20 09:00:22 +01:00
|
|
|
programs = {
|
|
|
|
bash.enable = true;
|
|
|
|
readline = {
|
|
|
|
enable = true;
|
|
|
|
includeSystemConfig = true;
|
|
|
|
extraConfig = ''
|
|
|
|
set completion-ignore-case On
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
direnv = {
|
|
|
|
enable = true;
|
|
|
|
nix-direnv.enable = true;
|
|
|
|
enableBashIntegration = true;
|
|
|
|
enableZshIntegration = true;
|
|
|
|
};
|
2023-10-09 11:40:25 +01:00
|
|
|
fzf = {
|
|
|
|
enable = true;
|
|
|
|
enableBashIntegration = true;
|
|
|
|
enableZshIntegration = true;
|
|
|
|
};
|
2023-11-07 09:19:03 +00:00
|
|
|
bat.enable = true;
|
2023-10-09 11:40:25 +01:00
|
|
|
git = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.gitFull;
|
|
|
|
userName = "Evie Litherland-Smith";
|
|
|
|
userEmail = lib.mkDefault "evie@xenia.me.uk";
|
|
|
|
delta = {
|
|
|
|
enable = true;
|
|
|
|
options = {
|
|
|
|
line-numbers = true;
|
2023-10-20 15:23:16 +01:00
|
|
|
hyprlinks = true;
|
2023-10-09 11:40:25 +01:00
|
|
|
navigate = true;
|
|
|
|
side-by-side = true;
|
2023-11-12 13:24:09 +00:00
|
|
|
syntax-theme = "tokyonight_night";
|
2023-10-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
extraConfig = {
|
|
|
|
pull.rebase = false;
|
|
|
|
init.defaultBranch = "main";
|
2023-10-20 15:23:16 +01:00
|
|
|
merge.conflictstyle = "diff3";
|
|
|
|
diff.colorMoved = "default";
|
2023-10-09 11:40:25 +01:00
|
|
|
credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
forwardAgent = true;
|
|
|
|
serverAliveInterval = 15;
|
|
|
|
serverAliveCountMax = 3;
|
|
|
|
controlMaster = "auto";
|
|
|
|
controlPersist = "10s";
|
|
|
|
extraConfig = ''
|
|
|
|
AddKeysToAgent=yes
|
|
|
|
SetEnv TERM=xterm-256color
|
|
|
|
'';
|
|
|
|
matchBlocks = {
|
2023-10-20 15:23:16 +01:00
|
|
|
"git*".user = "git";
|
2023-10-09 11:40:25 +01:00
|
|
|
"legion" = {
|
2023-10-22 06:52:38 +01:00
|
|
|
user = "root";
|
2023-10-09 11:40:25 +01:00
|
|
|
hostname = "192.168.1.230";
|
|
|
|
};
|
|
|
|
"ionos" = {
|
|
|
|
user = "root";
|
|
|
|
hostname = "77.68.67.133";
|
|
|
|
};
|
2023-10-20 15:23:16 +01:00
|
|
|
"freia" = {
|
2023-10-09 11:40:25 +01:00
|
|
|
user = "elitherl";
|
2023-10-20 15:23:16 +01:00
|
|
|
hostname = "freia020.hpc.l";
|
2023-10-09 11:40:25 +01:00
|
|
|
compression = true;
|
2023-10-20 15:23:16 +01:00
|
|
|
localForwards = [{
|
|
|
|
bind.port = 6702;
|
|
|
|
host = {
|
|
|
|
address = "127.0.0.1";
|
|
|
|
port = 6702;
|
|
|
|
};
|
|
|
|
}];
|
2023-10-09 11:40:25 +01:00
|
|
|
};
|
2023-11-02 11:04:49 +00:00
|
|
|
"heimdall" = {
|
|
|
|
user = "elitherl";
|
|
|
|
hostname = "heimdall003.jet.uk";
|
|
|
|
compression = true;
|
|
|
|
};
|
2023-10-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
starship = {
|
|
|
|
enable = true;
|
|
|
|
enableBashIntegration = true;
|
|
|
|
enableZshIntegration = true;
|
|
|
|
settings = {
|
|
|
|
command_timeout = 1000;
|
|
|
|
add_newline = true;
|
|
|
|
character = {
|
2023-10-15 12:27:16 +01:00
|
|
|
success_symbol = "[➜](bold green)";
|
|
|
|
error_symbol = "[✗](bold red)";
|
2023-10-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
directory = {
|
|
|
|
truncation_length = 2;
|
|
|
|
fish_style_pwd_dir_length = 1;
|
|
|
|
read_only = " ";
|
|
|
|
truncate_to_repo = false;
|
|
|
|
};
|
|
|
|
line_break.disabled = false;
|
|
|
|
git_branch = {
|
2023-10-13 09:55:41 +01:00
|
|
|
symbol = " ";
|
2023-10-09 11:40:25 +01:00
|
|
|
only_attached = true;
|
|
|
|
ignore_branches = [ "master" "main" ];
|
|
|
|
};
|
|
|
|
git_commit = {
|
2023-10-15 17:02:24 +01:00
|
|
|
format = "[ $hash | $tag]($style) ";
|
|
|
|
tag_symbol = " ";
|
2023-10-09 11:40:25 +01:00
|
|
|
tag_disabled = false;
|
|
|
|
};
|
|
|
|
git_metrics.disabled = false;
|
|
|
|
hostname = {
|
|
|
|
ssh_only = true;
|
|
|
|
ssh_symbol = " ";
|
|
|
|
};
|
|
|
|
localip.disabled = false;
|
|
|
|
memory_usage = {
|
|
|
|
disabled = false;
|
|
|
|
symbol = " ";
|
|
|
|
};
|
|
|
|
nix_shell.symbol = " ";
|
|
|
|
os = {
|
|
|
|
disabled = false;
|
|
|
|
format = "on [$symbol $name ]($style)";
|
2023-10-15 12:27:16 +01:00
|
|
|
style = "bold blue";
|
2023-10-09 11:40:25 +01:00
|
|
|
symbols = {
|
|
|
|
Alpine = " ";
|
|
|
|
Android = " ";
|
|
|
|
Arch = " ";
|
|
|
|
CentOS = " ";
|
|
|
|
Debian = " ";
|
|
|
|
EndeavourOS = " ";
|
|
|
|
Fedora = " ";
|
|
|
|
FreeBSD = " ";
|
|
|
|
Gentoo = " ";
|
|
|
|
Illumos = " ";
|
|
|
|
Linux = " ";
|
|
|
|
Macos = " ";
|
|
|
|
Manjaro = " ";
|
|
|
|
Mint = " ";
|
|
|
|
NixOS = " ";
|
|
|
|
OpenBSD = " ";
|
|
|
|
openSUSE = " ";
|
|
|
|
Pop = " ";
|
|
|
|
Raspbian = " ";
|
|
|
|
Redhat = " ";
|
|
|
|
RedHatEnterprise = " ";
|
|
|
|
Solus = " ";
|
|
|
|
SUSE = " ";
|
|
|
|
Ubuntu = " ";
|
|
|
|
Unknown = " ";
|
|
|
|
Windows = " ";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
python = {
|
|
|
|
symbol = " ";
|
|
|
|
python_binary = "python3";
|
|
|
|
};
|
2023-10-15 17:02:24 +01:00
|
|
|
rust = { symbol = " "; };
|
2023-10-09 11:40:25 +01:00
|
|
|
shell = {
|
|
|
|
disabled = false;
|
|
|
|
format = "using [$indicator ]($style)";
|
|
|
|
};
|
|
|
|
sudo = {
|
|
|
|
disabled = false;
|
|
|
|
symbol = " ";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
tmux = {
|
|
|
|
enable = true;
|
|
|
|
baseIndex = 1;
|
|
|
|
clock24 = true;
|
|
|
|
keyMode = "emacs";
|
|
|
|
mouse = true;
|
|
|
|
secureSocket = true;
|
|
|
|
sensibleOnTop = true;
|
|
|
|
shortcut = "Space";
|
|
|
|
terminal = "xterm-256color";
|
2023-10-14 20:49:30 +01:00
|
|
|
plugins = with pkgs.tmuxPlugins; [ yank tmux-fzf ];
|
2023-10-09 11:40:25 +01:00
|
|
|
extraConfig = ''
|
|
|
|
# https://old.reddit.com/r/tmux/comments/mesrci/tmux_2_doesnt_seem_to_use_256_colors/
|
2023-11-08 09:56:37 +00:00
|
|
|
set -ga terminal-overrides ",*256col*,alacritty:Tc"
|
2023-10-09 11:40:25 +01:00
|
|
|
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
|
|
|
|
set-environment -g COLORTERM "truecolor"
|
|
|
|
|
|
|
|
# easy-to-remember split pane commands
|
|
|
|
bind | split-window -h -c "#{pane_current_path}"
|
|
|
|
bind - split-window -v -c "#{pane_current_path}"
|
|
|
|
bind c new-window -c "#{pane_current_path}"
|
|
|
|
'';
|
|
|
|
};
|
2023-09-20 09:00:22 +01:00
|
|
|
zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
syntaxHighlighting.enable = true;
|
|
|
|
enableVteIntegration = true;
|
|
|
|
autocd = true;
|
|
|
|
dotDir = ".config/zsh";
|
|
|
|
historySubstringSearch.enable = true;
|
|
|
|
history.path = "${config.xdg.dataHome}/zsh/history";
|
|
|
|
initExtra = ''
|
|
|
|
xdg-query-program () {
|
|
|
|
FILETYPE=$(xdg-mime query filetype $@)
|
|
|
|
DEFAULT=$(xdg-mime query default $FILETYPE)
|
|
|
|
echo "$FILETYPE -> $DEFAULT"
|
|
|
|
}
|
2023-09-28 13:46:08 +01:00
|
|
|
rsync-local-config () {
|
|
|
|
HOST=$1
|
2023-11-06 14:10:13 +00:00
|
|
|
for TARGET in bat git emacs/init.el starship.toml; do
|
2023-09-28 13:46:08 +01:00
|
|
|
SOURCE="${config.xdg.configHome}/$TARGET"
|
2023-11-02 11:04:49 +00:00
|
|
|
TMP_TARGET=/tmp/rsync-local-config
|
2023-10-20 16:31:35 +01:00
|
|
|
TMP_SOURCE=$TMP_TARGET
|
|
|
|
NIX_SED="${pkgs.gnused}/bin/sed -i 's|/nix/.*/bin/||g'"
|
|
|
|
NIX_REPLACE="$NIX_SED $TMP_TARGET"
|
2023-09-28 13:46:08 +01:00
|
|
|
if [[ -e ${config.xdg.configHome}/$TARGET ]]; then
|
2023-10-20 16:31:35 +01:00
|
|
|
if [[ -d $SOURCE ]]; then
|
|
|
|
SOURCE=$SOURCE/
|
|
|
|
TMP_SOURCE=$TMP_SOURCE/
|
|
|
|
NIX_REPLACE="${pkgs.fd}/bin/fd -g '**' $TMP_TARGET -tfile -x $NIX_SED {};"
|
|
|
|
fi
|
2023-11-02 11:04:49 +00:00
|
|
|
${pkgs.rsync}/bin/rsync -avzL --exclude=".git*" $SOURCE $TMP_TARGET
|
2023-10-24 14:43:39 +01:00
|
|
|
${pkgs.coreutils}/bin/chmod u+rw -R $TMP_SOURCE
|
2023-10-20 16:31:35 +01:00
|
|
|
${pkgs.bash}/bin/sh -c "$NIX_REPLACE"
|
2023-11-02 11:04:49 +00:00
|
|
|
${pkgs.rsync}/bin/rsync -avzL --delete --exclude=".git*" $TMP_SOURCE $HOST:.config/$TARGET
|
2023-10-20 16:31:35 +01:00
|
|
|
${pkgs.coreutils}/bin/rm -rf $TMP_SOURCE
|
2023-09-28 13:46:08 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
2023-09-20 09:00:22 +01:00
|
|
|
'';
|
|
|
|
oh-my-zsh = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [
|
|
|
|
# Productivity
|
|
|
|
"aliases"
|
|
|
|
"colored-man-pages"
|
|
|
|
"command-not-found"
|
|
|
|
"extract"
|
|
|
|
# Build tools
|
|
|
|
"git"
|
|
|
|
"gitignore"
|
|
|
|
# Misc
|
|
|
|
"lol"
|
|
|
|
"rand-quote"
|
|
|
|
];
|
|
|
|
theme = "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-09-15 07:13:52 +01:00
|
|
|
}
|