146 lines
3.3 KiB
Nix
146 lines
3.3 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# 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";
|
|
|
|
# Configure PATH for all shells, including non-interactive ones
|
|
home.sessionPath = [
|
|
"${config.home.homeDirectory}/.local/bin"
|
|
"${config.home.homeDirectory}/.nix-profile/bin"
|
|
"/nix/var/nix/profiles/default/bin"
|
|
];
|
|
|
|
# Nix configuration
|
|
nix = {
|
|
enable = true;
|
|
package = pkgs.nix;
|
|
settings = {
|
|
experimental-features = ["nix-command" "flakes"];
|
|
warn-dirty = false;
|
|
};
|
|
};
|
|
|
|
# Set environment variables for all shells
|
|
home.sessionVariables = {
|
|
# Use bwrap for nix-portable
|
|
NP_RUNTIME = "bwrap";
|
|
|
|
# This is missing for some reason and breaks alls kinds of Maven compilations.
|
|
MAVEN_OPTS="-Duser.home=${config.home.homeDirectory}";
|
|
};
|
|
|
|
# Create SSH environment file for non-interactive sessions
|
|
# This helps with SSH commands that don't source profile files
|
|
home.file.".ssh/environment".text = ''
|
|
PATH=${config.home.homeDirectory}/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH
|
|
NIX_PATH=${config.home.homeDirectory}/.nix-defexpr/channels:nixpkgs=${config.home.homeDirectory}/.nix-defexpr/channels/nixpkgs
|
|
'';
|
|
|
|
# Packages to install
|
|
home.packages = with pkgs; [
|
|
nix
|
|
eza
|
|
|
|
# Version control
|
|
git
|
|
delta
|
|
|
|
# Languages and runtimes
|
|
python3
|
|
|
|
# System tools
|
|
coreutils
|
|
findutils
|
|
gnused
|
|
gawk
|
|
|
|
# Networking tools
|
|
curl
|
|
wget
|
|
|
|
# Archive tools
|
|
unzip
|
|
zip
|
|
|
|
# Process management
|
|
htop
|
|
btop
|
|
|
|
# JSON/YAML tools
|
|
jq
|
|
yq
|
|
|
|
bash
|
|
bash-completion
|
|
|
|
ncdu
|
|
screen
|
|
|
|
|
|
ripgrep
|
|
gnupg
|
|
];
|
|
|
|
# Bash configuration
|
|
programs.bash = {
|
|
enable = true;
|
|
enableCompletion = true;
|
|
|
|
# This is sourced by both interactive and non-interactive shells
|
|
# Critical for SSH non-interactive sessions
|
|
profileExtra = ''
|
|
# Ensure Nix paths are properly set up for all shells
|
|
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
|
|
if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
|
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
|
fi
|
|
'';
|
|
|
|
# This is only sourced by interactive shells
|
|
initExtra = ''
|
|
# Additional interactive shell settings can go here
|
|
'';
|
|
|
|
shellAliases = {
|
|
"hm-up" = "nix-portable nix run github:nix-community/home-manager/release-25.05 -- switch --refresh --flake 'git+https://g.t1.xyz/tb/nix-ebay-home.git#tbingmann'";
|
|
|
|
"np" = "nix-portable nix run nixpkgs#bashInteractive --offline";
|
|
};
|
|
};
|
|
|
|
# Git configuration
|
|
programs.git = {
|
|
enable = true;
|
|
userName = "Timo Bingmann";
|
|
userEmail = "tbingmann@ebay.com";
|
|
|
|
extraConfig = {
|
|
credential.helper = "store --file ~/.git-credentials";
|
|
|
|
commit.gpgsign = true;
|
|
};
|
|
};
|
|
|
|
# GnuPG configuration
|
|
programs.gpg = {
|
|
enable = true;
|
|
};
|
|
|
|
services.gpg-agent = {
|
|
enable = true;
|
|
enableScDaemon = false;
|
|
enableSshSupport = false;
|
|
pinentry = {
|
|
package = pkgs.pinentry-curses;
|
|
};
|
|
};
|
|
}
|