1
0
This commit is contained in:
Timo Bingmann
2025-07-09 13:56:42 -07:00
parent c38493b68b
commit b32484695f
2 changed files with 102 additions and 90 deletions

115
home.nix
View File

@@ -4,126 +4,61 @@
# Home Manager needs a bit of information about you and the paths it should manage
home.username = "tbingmann";
home.homeDirectory = "/home/tbingmann";
# Basic configuration
home.stateVersion = "25.05";
# Let Home Manager install and manage itself
programs.home-manager.enable = true;
# Nix configuration
nix = {
enable = true;
package = pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes"];
warn-dirty = false;
};
};
# Packages to install
home.packages = with pkgs; [
# Basic utilities
coreutils
curl
wget
htop
ripgrep
fd
jq
tree
];
# Bash configuration
programs.bash = {
enable = true;
enableCompletion = true;
# Shell aliases
shellAliases = {
ll = "ls -la";
".." = "cd ..";
"..." = "cd ../..";
"grep" = "grep --color=auto";
"rm" = "rm -i";
"cp" = "cp -i";
"mv" = "mv -i";
};
# Bash initialization
initExtra = ''
# Custom prompt
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# Additional bash customizations
export EDITOR=vim
export PATH="$HOME/.local/bin:$PATH"
# History settings
export HISTSIZE=10000
export HISTFILESIZE=10000
export HISTCONTROL=ignoreboth:erasedups
# Custom functions
function mkcd() {
mkdir -p "$1" && cd "$1"
}
# Ensure Nix paths are properly set up
export PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
export NIX_PATH="$HOME/.nix-defexpr/channels:nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs"
# Source nix environment if it exists and not already sourced
if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ] && [ -z "$NIX_SOURCED" ]; then
export NIX_SOURCED=1
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
fi
'';
# History configuration
historyControl = [
"erasedups"
"ignoredups"
"ignorespace"
];
historyFileSize = 10000;
historySize = 10000;
historyFileSize = 1000000;
historySize = 1000000;
};
# Direnv configuration
programs.direnv = {
enable = true;
nix-direnv.enable = true;
# Add hook to .bashrc
enableBashIntegration = true;
# Configuration
config = {
whitelist = {
prefix = [
"$HOME/projects"
"$HOME/work"
];
};
};
};
# Git configuration (useful with direnv)
programs.git = {
enable = true;
userName = "tbingmann";
userEmail = "tbingmann@example.com"; # Replace with actual email
# Basic configuration
extraConfig = {
core.editor = "vim";
init.defaultBranch = "main";
pull.rebase = false;
};
};
# Create default .envrc template in home directory
home.file.".envrc-template" = {
text = ''
# This is a template .envrc file for use with direnv
# Copy this to your project directory and customize as needed
# Load environment variables from .env file if it exists
if [ -f .env ]; then
dotenv
fi
# Example: Set project-specific environment variables
# export PROJECT_ROOT=$(pwd)
# export PATH=$PROJECT_ROOT/bin:$PATH
# Example: Use Nix shell
# use nix
# Example: Use flake
# use flake
'';
executable = false;
};
}