1
0
Files
nix-ebay-home/home.nix

146 lines
3.3 KiB
Nix
Raw Normal View History

2025-07-09 13:39:51 -07:00
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should manage
home.username = "tbingmann";
home.homeDirectory = "/home/tbingmann";
2025-07-09 13:56:42 -07:00
2025-07-09 13:39:51 -07:00
# Basic configuration
home.stateVersion = "25.05";
2025-07-09 14:32:26 -07:00
# Configure PATH for all shells, including non-interactive ones
home.sessionPath = [
2025-07-17 21:07:58 -07:00
"${config.home.homeDirectory}/.local/bin"
2025-07-09 14:32:26 -07:00
"${config.home.homeDirectory}/.nix-profile/bin"
"/nix/var/nix/profiles/default/bin"
];
2025-07-09 13:56:42 -07:00
# Nix configuration
nix = {
enable = true;
package = pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes"];
warn-dirty = false;
};
};
2025-07-09 14:32:26 -07:00
# Set environment variables for all shells
home.sessionVariables = {
2025-07-17 21:07:58 -07:00
# Use bwrap for nix-portable
NP_RUNTIME = "bwrap";
2025-07-18 17:27:08 -07:00
# This is missing for some reason and breaks alls kinds of Maven compilations.
MAVEN_OPTS="-Duser.home=${config.home.homeDirectory}";
2025-07-09 14:32:26 -07:00
};
2025-07-09 14:38:45 -07:00
# 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
'';
2025-07-09 13:39:51 -07:00
# Packages to install
home.packages = with pkgs; [
2025-07-17 21:07:58 -07:00
nix
2025-07-09 14:32:26 -07:00
eza
2025-07-18 17:27:08 -07:00
2025-07-18 19:49:06 -07:00
# 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
2025-07-18 17:27:08 -07:00
ripgrep
2025-07-18 19:49:06 -07:00
gnupg
2025-07-09 13:39:51 -07:00
];
# Bash configuration
programs.bash = {
enable = true;
enableCompletion = true;
2025-07-09 13:56:42 -07:00
2025-07-09 14:38:45 -07:00
# 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
2025-07-09 13:56:42 -07:00
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"
2025-07-09 14:38:45 -07:00
# Source nix environment if it exists
if [ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
2025-07-09 13:56:42 -07:00
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
fi
2025-07-09 13:39:51 -07:00
'';
2025-07-09 13:56:42 -07:00
2025-07-09 14:38:45 -07:00
# This is only sourced by interactive shells
initExtra = ''
# Additional interactive shell settings can go here
'';
2025-07-09 14:32:26 -07:00
shellAliases = {
2025-07-18 17:27:08 -07:00
"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";
2025-07-09 14:32:26 -07:00
};
2025-07-18 19:49:06 -07:00
};
# Git configuration
programs.git = {
enable = true;
userName = "Timo Bingmann";
userEmail = "tbingmann@ebay.com";
extraConfig = {
credential.helper = "store --file ~/.git-credentials";
2025-07-09 14:32:26 -07:00
2025-07-18 19:49:06 -07:00
commit.gpgsign = true;
};
2025-07-09 13:39:51 -07:00
};
2025-07-18 19:49:06 -07:00
# GnuPG configuration
programs.gpg = {
2025-07-09 13:39:51 -07:00
enable = true;
2025-07-18 19:49:06 -07:00
};
2025-07-09 13:56:42 -07:00
2025-07-18 19:49:06 -07:00
services.gpg-agent = {
enable = true;
enableScDaemon = false;
enableSshSupport = false;
pinentry = {
package = pkgs.pinentry-curses;
};
2025-07-09 13:39:51 -07:00
};
}