aboutsummaryrefslogtreecommitdiffstats
path: root/openspec/specs/shell-login-bootstrap
diff options
context:
space:
mode:
Diffstat (limited to 'openspec/specs/shell-login-bootstrap')
-rw-r--r--openspec/specs/shell-login-bootstrap/spec.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/openspec/specs/shell-login-bootstrap/spec.md b/openspec/specs/shell-login-bootstrap/spec.md
new file mode 100644
index 0000000..3bf6246
--- /dev/null
+++ b/openspec/specs/shell-login-bootstrap/spec.md
@@ -0,0 +1,35 @@
1# shell-login-bootstrap Specification
2
3## Purpose
4
5Ensures a login shell actually loads the user's bash configuration, since NixOS and most other Linux distributions don't ship a `~/.bash_profile` that sources `~/.bashrc` by default — without ever touching a `~/.bash_profile` that already exists.
6
7## Requirements
8
9### Requirement: A missing `.bash_profile` is created to source `.bashrc`
10If no `~/.bash_profile` exists, home-manager activation SHALL create one whose contents source `~/.bashrc`.
11
12#### Scenario: No `.bash_profile` exists
13- **WHEN** activation runs and `~/.bash_profile` does not exist
14- **THEN** a `~/.bash_profile` is created that sources `~/.bashrc`
15
16### Requirement: An existing `.bash_profile` is never modified
17If `~/.bash_profile` already exists in any form (regular file or symlink), activation SHALL NOT create, overwrite, or otherwise modify it.
18
19#### Scenario: `.bash_profile` already exists
20- **WHEN** activation runs and `~/.bash_profile` already exists
21- **THEN** its contents are left completely unchanged, and no write is attempted
22
23### Requirement: The created file tolerates a missing `.bashrc`
24The generated `~/.bash_profile` SHALL only attempt to source `~/.bashrc` if that file exists, so it never errors on a login shell that runs before `~/.bashrc` is otherwise provisioned.
25
26#### Scenario: `.bashrc` does not exist yet
27- **WHEN** the generated `~/.bash_profile` runs and `~/.bashrc` does not exist
28- **THEN** it does nothing further and produces no error
29
30### Requirement: Behavior is identical on every platform this flake targets
31This capability SHALL apply unconditionally wherever the shared home-manager profile is activated — NixOS, standalone Linux, and macOS alike — gated only by whether `~/.bash_profile` already exists, not by operating system.
32
33#### Scenario: Activated on any supported platform
34- **WHEN** the shared home profile is activated on NixOS, standalone Linux, or macOS
35- **THEN** the same create-if-absent behavior for `~/.bash_profile` applies identically