Skip to content

Commit

Permalink
nixos/java: No bashisms in environment.shellInit script
Browse files Browse the repository at this point in the history
Running dash (the lightweight Debian Almquist shell) results in

```
source: not found
```

For this line which ends up in `/etc/profile`. Let's use `.` instead, according to [the Ubuntu wiki](https://wiki.ubuntu.com/DashAsBinSh#source) and [`checkbashisms`](https://sourceforge.net/projects/checkbaskisms/):

```
possible bashism in /etc/profile line [...] (should be '.', not 'source'):
test -e /nix/store/[...]/nix-support/setup-hook && source /nix/store/[...]/nix-support/setup-hook
```

(cherry picked from commit 9692e2e)
  • Loading branch information
lorenzleutgeb authored and github-actions[bot] committed Dec 1, 2024
1 parent d634159 commit ca59023
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/programs/java.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ in
environment.systemPackages = [ cfg.package ];

environment.shellInit = ''
test -e ${cfg.package}/nix-support/setup-hook && source ${cfg.package}/nix-support/setup-hook
test -e ${cfg.package}/nix-support/setup-hook && . ${cfg.package}/nix-support/setup-hook
'';

};
Expand Down

0 comments on commit ca59023

Please sign in to comment.