From 8fa7344435dbf81accb0751b48fc4bd776a201ff Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 21 Sep 2026 12:15:03 +0200 Subject: Add always-on ~/.bash_profile bootstrap for login shells NixOS and most other Linux distros don't ship a ~/.bash_profile that sources ~/.bashrc, so login shells miss the user's bash config. Adds a home-manager activation script that creates one only when absent, on every platform, without ever touching a pre-existing .bash_profile. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BBSd4VBfoKHjE1HR3P8kmn --- .../changes/add-bash-profile-bootstrap/proposal.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 openspec/changes/add-bash-profile-bootstrap/proposal.md (limited to 'openspec/changes/add-bash-profile-bootstrap/proposal.md') diff --git a/openspec/changes/add-bash-profile-bootstrap/proposal.md b/openspec/changes/add-bash-profile-bootstrap/proposal.md new file mode 100644 index 0000000..6991c2a --- /dev/null +++ b/openspec/changes/add-bash-profile-bootstrap/proposal.md @@ -0,0 +1,22 @@ +## Why + +NixOS (and most other Linux distros) don't ship a `~/.bash_profile` that sources `~/.bashrc`, so login shells never pick up the user's bash config — only interactive non-login shells do. This repo made bash the primary managed shell in an earlier change (`add-developer-environment`), and the real `.bashrc` lives in the user's external dotfiles repo (`~/dotfiles/bash/.bashrc`, stowed to `~/.bashrc` by `modules/home/dotfiles.nix`), so this gap is real on any freshly provisioned machine. + +## What Changes + +- Add a new home-manager activation script that creates `~/.bash_profile` (sourcing `~/.bashrc` if present) only when `~/.bash_profile` does not already exist. An existing `~/.bash_profile`, in any form (regular file or symlink), is never modified. +- Applies unconditionally on every platform this flake targets (Linux and macOS) — not gated by `home.dotfiles.repoUrl` — since the exists-check itself is what keeps it safe everywhere, including on a machine with an existing, repo-unmanaged `~/.bash_profile`. + +## Capabilities + +### New Capabilities +- `shell-login-bootstrap`: ensures a login shell sources `~/.bashrc` via `~/.bash_profile`, creating that file only when it doesn't already exist, on every platform this flake targets. + +### Modified Capabilities +(none — `dotfiles-management`'s existing "a conflicting package does not block the others" requirement already covers the rare case where a dotfiles-repo-provided `.bash_profile` package races against this file; no requirement of that capability changes) + +## Impact + +- Affected code: a new `modules/home/` module, registered in `modules/home/default.nix`'s imports; `README.md`'s documentation of the home-manager module layout and shell setup. +- Applies to every `homeConfigurations`/`nixosConfigurations` output built from the shared home profile (both `tom@linux` and `tom@darwin`, plus any future NixOS host). +- No change to `dotfiles.nix` or its behavior. -- cgit v1.3