174 lines
3.8 KiB
Nix
174 lines
3.8 KiB
Nix
{ pkgs, email, name, sshSignKey, ... }:
|
|
let
|
|
in
|
|
{
|
|
atuin.enable = true;
|
|
|
|
bat.enable = true;
|
|
|
|
eza = {
|
|
enable = true;
|
|
};
|
|
|
|
gh = {
|
|
enable = true;
|
|
settings = {
|
|
git_protocol = "ssh";
|
|
version = 1;
|
|
};
|
|
};
|
|
|
|
git = {
|
|
enable = true;
|
|
aliases = {
|
|
co = "checkout";
|
|
l = "log --graph --decorate --pretty=oneline --abbrev-commit";
|
|
prune = "fetch --prune";
|
|
stash-all = "stash save --include-untracked";
|
|
s = "status";
|
|
};
|
|
ignores = [
|
|
".DS_Store"
|
|
".svn"
|
|
"*~"
|
|
"*.swp"
|
|
"*.rbc"
|
|
".idea/"
|
|
"__pycache__/"
|
|
".vscode"
|
|
".clangd/"
|
|
".direnv/"
|
|
"compile_commands.json"
|
|
"*.sublime-project"
|
|
"*.sublime-workspace"
|
|
"build.nosync/"
|
|
".cache/"
|
|
];
|
|
userName = name;
|
|
userEmail = email;
|
|
lfs.enable = true;
|
|
extraConfig = {
|
|
init.defaultBranch = "develop";
|
|
pull.ff = true;
|
|
push.default = "simple";
|
|
rebase.autoStash = true;
|
|
|
|
credential.helper = "osxkeychain";
|
|
|
|
commit.gpgsign = true;
|
|
gpg.format = "ssh";
|
|
user.signingkey = sshSignKey;
|
|
};
|
|
};
|
|
|
|
kitty = {
|
|
darwinLaunchOptions = [ "--single-instance" ];
|
|
enable = true;
|
|
font = {
|
|
name = "BerkeleyMono Nerd Font Mono";
|
|
size = 14;
|
|
};
|
|
settings = {
|
|
cursor_shape = "underline";
|
|
confirm_os_window_close = 0;
|
|
};
|
|
themeFile = "Catppuccin-Latte";
|
|
};
|
|
|
|
ssh = {
|
|
enable = true;
|
|
matchBlocks = {
|
|
optimization = {
|
|
hostname = "compute.optimisation-2020.cloud.edu.au";
|
|
user = "dekker1";
|
|
};
|
|
nitrogen = {
|
|
hostname = "nitrogen.dekker.li";
|
|
user = "jdekker";
|
|
};
|
|
m3 = {
|
|
hostname = "m3-login3.massive.org.au";
|
|
user = "jdekker";
|
|
};
|
|
};
|
|
};
|
|
|
|
starship = {
|
|
enable = true;
|
|
settings = (with builtins; fromTOML (readFile ./config/starship-tokyo-night.toml)) // {
|
|
# Overrides
|
|
};
|
|
};
|
|
|
|
topgrade = {
|
|
enable = true;
|
|
settings = {
|
|
misc.disable = [
|
|
"brew_cask"
|
|
# "brew_formula"
|
|
"containers"
|
|
"gem"
|
|
"node"
|
|
"pnpm"
|
|
"ruby_gems"
|
|
"tlmgr"
|
|
"vim"
|
|
"yarn"
|
|
];
|
|
misc.assume_yes = true;
|
|
misc.cleanup = true;
|
|
misc.no_retry = true;
|
|
pre_commands = {
|
|
"Home Manager" = "(cd ~/nix-config/ && nix flake update) && darwin-rebuild switch --flake ~/nix-config#aarch64-darwin";
|
|
};
|
|
};
|
|
};
|
|
|
|
vscode = {
|
|
enable = false;
|
|
package = pkgs.vscodium;
|
|
};
|
|
|
|
zoxide = {
|
|
enable = true;
|
|
};
|
|
|
|
zsh = {
|
|
enable = true;
|
|
autocd = true;
|
|
defaultKeymap = "viins";
|
|
completionInit = ''
|
|
autoload -Uz compinit && compinit
|
|
zstyle ':completion:*' matcher-list ''' 'm:{a-zA-Z}={A-Za-z}'
|
|
'';
|
|
shellAliases = {
|
|
edit = "$VISUAL";
|
|
start = "open";
|
|
less = "bat";
|
|
ls = "eza";
|
|
# set-light-theme = "kitty +kitten themes Catppuccin-Latte";
|
|
# set-dark-theme = "kitty +kitten themes Catppuccin-Frappe";
|
|
};
|
|
sessionVariables = {
|
|
# Set default editor
|
|
EDITOR = "nvim";
|
|
VISUAL = "zed";
|
|
# CMake settings
|
|
CMAKE_EXPORT_COMPILE_COMMANDS = "1"; # output compile-commands.json for clangd
|
|
CMAKE_GENERATOR = "Ninja Multi-Config"; # use Ninja generator by default
|
|
CMAKE_C_COMPILER_LAUNCHER = "sccache";
|
|
CMAKE_CXX_COMPILER_LAUNCHER = "sccache";
|
|
# Rust settings
|
|
RUSTC_WRAPPER = "sccache";
|
|
};
|
|
initExtra = ''
|
|
# Load Homebrew shell environment
|
|
if [[ -f "/opt/homebrew/bin/brew" && -x $(realpath "/opt/homebrew/bin/brew") ]]; then
|
|
eval "$(/opt/homebrew/bin/brew shellenv)"
|
|
elif [[ -f "/usr/local/bin/brew" && -x $(realpath "/usr/local/bin/brew") ]]; then
|
|
eval "$(/usr/local/bin/brew shellenv)"
|
|
fi
|
|
'';
|
|
};
|
|
}
|