Skip to content

Instantly share code, notes, and snippets.

@will
Created November 18, 2022 15:14
Show Gist options
  • Save will/16bbddd82fd028e79da23aeef719bc94 to your computer and use it in GitHub Desktop.
Save will/16bbddd82fd028e79da23aeef719bc94 to your computer and use it in GitHub Desktop.
{ config, pkgs, ... }:
# https://mipmip.github.io/home-manager-option-search/
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
stateVersion = "22.05";
username = "will";
homeDirectory = "/Users/will";
packages = with pkgs; [
nil # nix lsp
nixpkgs-fmt
stylua
ripgrep
lazygit
fd
htop
yt-dlp
ffmpeg
];
sessionVariables = { EDITOR = "nvim"; };
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
# custom configuration
programs.git = {
enable = true;
diff-so-fancy.enable = true;
ignores = [
".DS_Store"
"*~"
"*.swp"
"*.swo"
".crystal"
"'"
".direnv"
];
aliases = {
b = "for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) (%(color:green)%(committerdate:relative)%(color:reset)) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) %(color:bold blue)<%(authorname)>%(color:reset)'";
ci = "commit";
co = "checkout";
ff = "merge --ff-only";
fixup = "commit --amend -C head";
l = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %f %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative main..";
lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %f %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all";
logl = "log --pretty=oneline --abbrev-commit --decorate";
ls = "!git ls-files -m | xargs ls -la";
unadd = "update-index --force-remove";
vain = "!/Users/will/code/git-vain/git-vain";
};
extraConfig = {
init = { defaultBranch = "main"; };
pull = { ff = "only"; };
push = { default = "tracking"; autoSetupRemote = true; };
rebase = { autoStash = true; updateRefs = true; };
rerere = { enabled = true; };
vain = { default = "cafe"; };
};
};
programs.fish = {
enable = true;
shellInit = ''
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish
end
'';
interactiveShellInit = ''
set -U Z_CMD "j"
set -U Z_OWNER "will"
set -gx DIRENV_LOG_FORMAT ""
'';
shellAliases = {
gco = "git checkout";
gd = "git diff";
gs = "git status";
h = "herkou";
hr = "heroku run -s performance-l";
vim = "nvim";
tailscale = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
};
shellAbbrs = {
v = "nvim";
};
functions = { };
plugins = [
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "85f863f20f24faf675827fb00f3a4e15c7838d76";
hash = "sha256-+FUBM7CodtZrYKqU542fQD+ZDGrd2438trKM0tIESs0=";
};
}
];
};
programs.fzf.enable = true;
nixpkgs.overlays = [
(import (builtins.fetchTarball {
url = "https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz";
}))
];
programs.neovim = {
enable = true;
package = pkgs.neovim-nightly;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment