Skip to content

Commit

Permalink
Copy over fish variable exports to bash
Browse files Browse the repository at this point in the history
  • Loading branch information
rounakdatta committed Jan 29, 2024
1 parent 83d5843 commit 3952c94
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
20 changes: 18 additions & 2 deletions configs/bash/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
{ config, pkgs, ... }: {
{ config, pkgs, ... }:
let
isDarwin = pkgs.stdenv.isDarwin;
in
{
programs.bash = {
enable = true;
initExtra = ''
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PASSWORD_STORE_DIR=/Users/${config.home.username}/.password-store
'';
'' +
(if isDarwin then
''
export PATH="$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:$PATH"
export PATH="$PATH:/etc/profiles/per-user/${config.home.username}/bin"
export PATH="$PATH:/opt/homebrew/bin"
export JAVA_HOME=/usr/libexec/java_home
export PASSWORD_STORE_DIR="/Users/${config.home.username}/.password-store"
''
else
''
''
);
};
}
12 changes: 6 additions & 6 deletions configs/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ in
'' +
(if isDarwin then
''
# this is needed, otherwise darwin-rebuild wouldn't be in PATH
fish_add_path --prepend --global "$HOME/.nix-profile/bin" /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
set PATH $PATH /etc/profiles/per-user/${config.home.username}/bin
set PATH $PATH /opt/homebrew/bin
set JAVA_HOME /usr/libexec/java_home
set PASSWORD_STORE_DIR /Users/${config.home.username}/.password-store
# this is needed, otherwise darwin-rebuild wouldn't be in PATH
fish_add_path --prepend --global "$HOME/.nix-profile/bin" /nix/var/nix/profiles/default/bin /run/current-system/sw/bin
set PATH $PATH /etc/profiles/per-user/${config.home.username}/bin
set PATH $PATH /opt/homebrew/bin
set JAVA_HOME /usr/libexec/java_home
set PASSWORD_STORE_DIR /Users/${config.home.username}/.password-store
''
else
''
Expand Down

0 comments on commit 3952c94

Please sign in to comment.