Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Nov 20, 2023
1 parent ef8a45c commit 5add0d8
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .config/nix/modules/colors.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
dark = {
background = "#1D1D1B";
foreground = "#ffffff";

black = "#1D1D1B";
blue = "#95b3d0";
cyan = "#7DE8E8";
green = "#94D1B3";
magenta = "#d98cd9";
orange = "#ffc799";
red = "#d6665c";
white = "#ffffff";
yellow = "#ffff66";
};

bright = {
background = "#FDFCF7";
foreground = "#000000";

black = "#000000";
blue = "#0026FF";
cyan = "#87FFC1";
green = "#DFFF9E";
magenta = "";
orange = "#F0BC91";
red = "#990000";
white = "#FDFCF7";
yellow = "#FFFF00";
};
}
4 changes: 4 additions & 0 deletions .config/nix/modules/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,19 @@
dock.tilesize = 48;
finder._FXShowPosixPathInTitle = true;
finder.AppleShowAllExtensions = true;
finder.AppleShowAllFiles = true;
finder.FXEnableExtensionChangeWarning = false;
finder.FXPreferredViewStyle = "Nlsv";
finder.QuitMenuItem = true;
finder.ShowPathbar = true;
finder.ShowStatusBar = true;
NSGlobalDomain."com.apple.mouse.tapBehavior" = 1.0;
NSGlobalDomain."com.apple.trackpad.scaling" = 3.0;
NSGlobalDomain._HIHideMenuBar = false;
NSGlobalDomain.AppleICUForce24HourTime = true;
NSGlobalDomain.AppleScrollerPagingBehavior = true;
NSGlobalDomain.AppleShowAllExtensions = true;
NSGlobalDomain.AppleShowAllFiles = true;
NSGlobalDomain.InitialKeyRepeat = 14;
NSGlobalDomain.KeyRepeat = 1;
};
Expand Down
34 changes: 34 additions & 0 deletions .config/nix/modules/ghostty.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ pkgs, ... }:
let
colors = import ./colors.nix;
in
{
# https://github.com/mitchellh/ghostty/blob/main/src/config/Config.zig
# TODO: Colors and config for different color schemes
# https://github.com/mitchellh/ghostty/issues/601
xdg.configFile."ghostty/config".text = ''
copy-on-select = "clipboard"
font-family = JetBrains Mono
font-feature = -calt
font-size = 14
macos-non-native-fullscreen = true
macos-option-as-alt = left
mouse-hide-while-typing = true
unfocused-split-opacity = 1
window-padding-x = 0
window-padding-y = 0
window-padding-balance = true
background = ${colors.dark.background}
foreground = ${colors.dark.foreground}
palette = 0=${colors.dark.black}
palette = 1=${colors.dark.red}
palette = 2=${colors.dark.green}
palette = 3=${colors.dark.yellow}
palette = 4=${colors.dark.blue}
palette = 5=${colors.dark.orange}
palette = 6=${colors.dark.cyan}
palette = 7=${colors.dark.white}
'';
}
66 changes: 66 additions & 0 deletions .config/nix/modules/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ pkgs, ... }: {
programs.git = {
enable = true;

aliases = {
a = "add";
aa = "add .";
au = "add --update";
b = "branch";
c = "commit -m";
cn = "commit --no-verify -m";
ch = "checkout";
l = "log";
p = "push";
pf = "push --force";
pl = "pull";
s = "status";

amend = "commit --amend --reuse-message=HEAD";
go = "!go() { git checkout -b $1 2> /dev/null || git checkout $1; }; go";
hist = "log --pretty=oneline --pretty=format:'%Cred%h%Creset %C(yellow)%an%Creset %s%C(normal dim)%d%Creset %Cgreen(%cr)%Creset' --date=relative --abbrev-commit";
monkeys = "shortlog --summary --numbered";
undo = "reset --soft HEAD^";
unstage = "reset HEAD --";
};

ignores = [
"*.un~"
".*.sw[a-z]"
".DS_Store"
".Spotlight-V100"
".Trashes"
"._*"
".env"
".envrc"
"Session.vim"
];

userName = "Tom Meagher";
userEmail = "[email protected]";

extraConfig = {
color.ui = "auto";
commit.gpgsign = true;
core = {
editor = "nvim";
excludesfile = "~/.config/git/ignore_global";
pager = "diff-so-fancy | less --tabs=4 -RFX";
};
credential.helper = "osxkeychain";
github.user = "tmm";
gpg = {
format = "ssh";
ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
};
init.defaultBranch = "main";
pull.rebase = false;
push = {
autoSetupRemote = true;
default = "current";
};
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHLwl9HCwJ1+kNCbrx3N15oIcNfW7SgZBTFlmQnQEVn4";
};
};
}

110 changes: 110 additions & 0 deletions .config/nix/modules/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{ pkgs, ... }: {
programs.fish = {
enable = true;
interactiveShellInit = ''
# Pure
# https://github.com/rafaelrinaldi/pure#configuration
set pure_color_primary white
set pure_color_success green
# Add a line to my prompt?
# https://github.com/pure-fish/pure/blob/master/conf.d/_pure_init.fish
functions --query _pure_prompt_new_line
# Add `pg_config` to path
# https://fishshell.com/docs/current/tutorial.html?highlight=fish_user_path#path
set PG_CONFIG /Applications/Postgres.app/Contents/Versions/latest/bin
fish_add_path $PG_CONFIG
# Set homebrew path
switch (arch)
case arm64
set BREW /opt/homebrew/bin
case x86_64
set BREW /usr/local/bin
end
fish_add_path $BREW
fnm env | source
zoxide init fish | source
set -gx PNPM_HOME "$HOME/.local/share/pnpm"
set -gx PATH "$PNPM_HOME" $PATH
set -gx FOUNDRY_DIR "$HOME/.foundry"
set -gx PATH "$FOUNDRY_DIR" $PATH
set FOUNDRY_BIN $HOME/.foundry/bin
fish_add_path $FOUNDRY_BIN
# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH
'';
plugins = [
# https://github.com/jorgebucaran/autopair.fish
{
name = "autopair.fish";
src = pkgs.fetchFromGitHub {
owner = "jorgebucaran";
repo = "autopair.fish";
rev = "4d1752ff5b39819ab58d7337c69220342e9de0e2";
sha256 = "sha256-s1o188TlwpUQEN3X5MxUlD/2CFCpEkWu83U9O+wg3VU=";
};
}
# https://github.com/jethrokuan/fzf
{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "fzf";
rev = "479fa67d7439b23095e01b64987ae79a91a4e283";
sha256 = "sha256-28QW/WTLckR4lEfHv6dSotwkAKpNJFCShxmKFGQQ1Ew=";
};
}
# https://github.com/pure-fish/pure
{
name = "pure";
src = pkgs.fetchFromGitHub {
owner = "pure-fish";
repo = "pure";
rev = "f1b2c7049de3f5cb45e29c57a6efef005e3d03ff";
sha256 = "sha256-MnlqKRmMNVp6g9tet8sr5Vd8LmJAbZqLIGoDE5rlu8E=";
};
}
];
shellAbbrs = {
a = "ambr";
b = "bun";
d = "devenv";
e = "edgedb";
df = "h git";
g = "git";
hm = "home-manager";
home = "cd ~";
lsd = "eza -d .*";
p = "pnpm";
v = "nvim";
};
shellAliases = {
cat = "bat --style=numbers,changes --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo tokyonight_night || echo tokyonight_day)";
find = "fd";
fup = "echo $fish_user_paths | tr \" \" \"\n\" | nl";
ghostty = "/Applications/Ghostty.app/Contents/MacOS/ghostty";
h = "env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files";
ls = "eza";
reload = "exec $SHELL -l";
vim = "nvim";
hide = "defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder";
show = "defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder";

nconf = "nvim ~/.config/nix/flake.nix";
vconf = "nvim ~/.config/nvim/init.lua";
drs = "darwin-rebuild switch --flake ~/.config/nix/";

hidedesktop = "defaults write com.apple.finder CreateDesktop -bool false && killall Finder";
showdesktop = "defaults write com.apple.finder CreateDesktop -bool true && killall Finder";
};
};
}

2 changes: 2 additions & 0 deletions .config/nix/nix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
substituters = https://cache.nixos.org https://cache.nixos.org/ https://devenv.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=
1 change: 1 addition & 0 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ require("lazy").setup({
hijack_netrw_behavior = "open_current",
},
window = {
position = "right",
width = 30,
},
},
Expand Down

0 comments on commit 5add0d8

Please sign in to comment.