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";
|
|
|
|
|
|
|
|
|
|
# Let Home Manager install and manage itself
|
|
|
|
|
programs.home-manager.enable = true;
|
|
|
|
|
|
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-09 14:38:45 -07:00
|
|
|
NIX_PATH = "${config.home.homeDirectory}/.nix-defexpr/channels:nixpkgs=${config.home.homeDirectory}/.nix-defexpr/channels/nixpkgs";
|
2025-07-17 21:07:58 -07:00
|
|
|
|
|
|
|
|
# Use bwrap for nix-portable
|
|
|
|
|
NP_RUNTIME = "bwrap";
|
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-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 = {
|
|
|
|
|
"hm-up" = "nix run github:nix-community/home-manager/release-25.05 -- switch --no-write-lock-file --refresh --flake 'git+https://g.t1.xyz/tb/nix-ebay-home.git#tbingmann'";
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-09 13:39:51 -07:00
|
|
|
# History configuration
|
|
|
|
|
historyControl = [
|
|
|
|
|
"erasedups"
|
|
|
|
|
"ignoredups"
|
|
|
|
|
"ignorespace"
|
|
|
|
|
];
|
2025-07-09 13:56:42 -07:00
|
|
|
historyFileSize = 1000000;
|
|
|
|
|
historySize = 1000000;
|
2025-07-09 13:39:51 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Direnv configuration
|
|
|
|
|
programs.direnv = {
|
|
|
|
|
enable = true;
|
|
|
|
|
nix-direnv.enable = true;
|
2025-07-09 13:56:42 -07:00
|
|
|
|
2025-07-09 13:39:51 -07:00
|
|
|
# Add hook to .bashrc
|
|
|
|
|
enableBashIntegration = true;
|
|
|
|
|
};
|
|
|
|
|
}
|