initial commit

This commit is contained in:
2024-07-30 00:09:42 -04:00
commit b2afed60e0
18 changed files with 690 additions and 0 deletions

9
home/atuin.nix Normal file
View File

@ -0,0 +1,9 @@
{ ... }:
{
programs.atuin = {
enable = true;
enableFishIntegration = true;
};
}

47
home/core.nix Normal file
View File

@ -0,0 +1,47 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nnn # terminal file manager
# archives
zip
xz
unzip
p7zip
# utils
ripgrep # recursively searches directories for a regex pattern
jq # A lightweight and flexible command-line JSON processor
yq-go # yaml processer https://github.com/mikefarah/yq
fzf # A command-line fuzzy finder
fh # flake hub command line interface
aria2 # A lightweight multi-protocol & multi-source command-line download utility
# misc
cowsay
file
which
tree
gnutar
gnupg
tmux
nerdfonts
zoxide
babelfish
# language-specific package managers
nodejs
cargo
python3
# productivity
iterm2
discord
obsidian
vscode
# games?
# prismlauncher
];
}

35
home/default.nix Normal file
View File

@ -0,0 +1,35 @@
{ username, ... }:
{
# import sub modules
imports = [
./atuin.nix
./shell.nix
./core.nix
./git.nix
./starship.nix
./eza.nix
./neovim.nix
./direnv.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = username;
homeDirectory = "/Users/${username}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "24.05";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}

14
home/direnv.nix Normal file
View File

@ -0,0 +1,14 @@
{ lib, config, ... }:
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config = {
global = {
hide_env_diff = true;
};
};
};
}

10
home/eza.nix Normal file
View File

@ -0,0 +1,10 @@
{ lib, config, ... }:
{
programs.eza = {
enable = true;
enableFishIntegration = true;
extraOptions = [
];
};
}

49
home/git.nix Normal file
View File

@ -0,0 +1,49 @@
{
lib,
username,
useremail,
...
}: {
# `programs.git` will generate the config file: ~/.config/git/config
# to make git use this config file, `~/.gitconfig` should not exist!
#
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f ~/.gitconfig
'';
programs.git = {
enable = true;
userName = username;
userEmail = useremail;
extraConfig = {
init.defaultBranch = "master";
push.autoSetupRemote = true;
pull.rebase = true;
};
ignores = [
".DS_Store"
".direnv"
".idea"
];
aliases = {
# common aliases
br = "branch";
co = "checkout";
st = "status";
ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate";
ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat";
cm = "commit -m";
ca = "commit -am";
dc = "diff --cached";
amend = "commit --amend -m";
# aliases for submodule
update = "submodule update --init --recursive";
foreach = "submodule foreach";
};
};
}

22
home/lazygit.nix Normal file
View File

@ -0,0 +1,22 @@
{ ... }:
{
programs.lazygit = {
enable = true;
settings = {
gui.theme = {
activeBorderColor = ["#a6e3a1" "bold"];
inactiveBorderColor = ["#a6adc8"];
optionsTextColor = ["#89b4fa"];
selectedLineBgColor = ["#313244"];
selectedRangeBgColor = ["#313244"];
cherryPickedCommitBgColor = ["#45475a"];
cherryPickedCommitFgColor = ["#a6e3a1"];
unstagedChangesColor = ["#f38ba8"];
defaultFgColor = ["#cdd6f4"];
searchingActiveBorderColor = ["#f9e2af"];
};
};
};
}

9
home/neovim.nix Normal file
View File

@ -0,0 +1,9 @@
{ lib, config, ... }:
{
programs.neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
};
}

66
home/shell.nix Normal file
View File

@ -0,0 +1,66 @@
{ pkgs, ... }: {
programs.fish = {
enable = true;
# initExtra = ''
# export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
# '';
shellAliases = {
# ls aliases
# ls = "eza --color $argv";
la = "eza -l -all --color $argv";
ll = "eza -l --color $argv";
lt = "eza -l --color --git $argv";
# lazygit alias
lg = "lazygit";
# cat, less, more alias
cat = "bat $argv";
less = "bat $argv";
more = "bat $argv";
};
functions = {
fish_greeting = {
body = ''
set memes \
"Crazy? I was crazy once. They locked me in a room. A rubber room. A rubber room with rats. And rats make me crazy." \
"Daddy, chill!" \
"What the hell is even that?!" \
"Road work ahead? Yeah, I sure hope it does!" \
"Look at all those chickens!" \
"I smell like beef" \
"Say, Coloardo - I'M A GIRAFFE" \
"I didn't get no sleep cause of y'all, y'all not gone get any sleep cause of me!" \
"This is the dollar store, how good can it be?" \
"That was legitness" \
"Deez nuts" \
"I wanna be a cowboy baby" \
"Can I get a waffle? Can I please get a waffle?" \
"I'm lesbian. I thought you were American."
set choose_meme (random)"%"(count $memes)
set choose_meme $memes[(math $choose_meme"+1")]
printf (set_color F90)"%s\n" $choose_meme
'';
onEvent = "fish_greeting";
};
};
};
programs.zsh = {
enable = true;
initExtra = ''
if [[ -z "$BASH_EXECUTION_STRING" ]]; then
if [[ -n "$ZSH_VERSION" ]]; then
LOGIN_OPTION="--login"
else
LOGIN_OPTION=""
fi
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
}

9
home/starship.nix Normal file
View File

@ -0,0 +1,9 @@
{ lib, config, ... }:
{
programs.starship = {
enable = true;
enableFishIntegration = true;
settings = { };
};
}