aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/bash-profile.nix21
-rw-r--r--modules/home/default.nix1
2 files changed, 22 insertions, 0 deletions
diff --git a/modules/home/bash-profile.nix b/modules/home/bash-profile.nix
new file mode 100644
index 0000000..30114ba
--- /dev/null
+++ b/modules/home/bash-profile.nix
@@ -0,0 +1,21 @@
1{ config, lib, pkgs, ... }:
2let
3 bashProfileContent = pkgs.writeText "bash_profile" ''
4 # Written once by home-manager (modules/home/bash-profile.nix) so login
5 # shells actually source ~/.bashrc — NixOS and other Linux distros don't
6 # ship a ~/.bash_profile that does this by default. Only created if it
7 # didn't already exist; home-manager never touches it again after that,
8 # so it's yours to edit.
9 if [ -f "$HOME/.bashrc" ]; then
10 . "$HOME/.bashrc"
11 fi
12 '';
13in
14{
15 home.activation.bashProfile = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
16 BASH_PROFILE=${lib.escapeShellArg "${config.home.homeDirectory}/.bash_profile"}
17 if [ ! -e "$BASH_PROFILE" ]; then
18 $DRY_RUN_CMD ${pkgs.coreutils}/bin/install -m 644 ${bashProfileContent} "$BASH_PROFILE"
19 fi
20 '';
21}
diff --git a/modules/home/default.nix b/modules/home/default.nix
index 89bad9e..1653d3b 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -1,6 +1,7 @@
1{ 1{
2 imports = [ 2 imports = [
3 ./shell.nix 3 ./shell.nix
4 ./bash-profile.nix
4 ./editor.nix 5 ./editor.nix
5 ./cli-tools.nix 6 ./cli-tools.nix
6 ./dotfiles.nix 7 ./dotfiles.nix