Skip to content

Commit 0524f61

Browse files
committed
Nix expr: add isFlake argument to shellHook
1 parent 1ddeff8 commit 0524f61

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ in {
174174
IDEs = {
175175
kate = [ kate omnisharp-roslyn ];
176176
};
177-
shellHook = drv: ''
177+
shellHook = isFlake: drv: ''
178178
export BIZHAWKBUILD_HOME='${builtins.toString ./.}'
179-
export BIZHAWK_HOME="$BIZHAWKBUILD_HOME/output/"
179+
export BIZHAWK_HOME="${if isFlake then "$(pwd -P)" else "$BIZHAWKBUILD_HOME"}/output/"
180180
ldLibPath='${lib.makeLibraryPath drv.buildInputs}' # for running tests
181181
if [ -z "$LD_LIBRARY_PATH" ]; then
182182
export LD_LIBRARY_PATH="$ldLibPath"

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
powershell
4747
];
4848
inputsFrom = [ drv ];
49-
shellHook = avail.shellHook drv;
49+
shellHook = avail.shellHook true drv;
5050
};
5151
in
5252
{

shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
++ lib.optionals useVSCode [] #TODO https://devblogs.microsoft.com/dotnet/csharp-dev-kit-now-generally-available/ https://learn.microsoft.com/en-us/training/modules/implement-visual-studio-code-debugging-tools/
2626
;
2727
inputsFrom = [ drv ];
28-
shellHook = avail.shellHook drv;
28+
shellHook = avail.shellHook false drv;
2929
};
3030
shells = lib.pipe avail [
3131
(lib.mapAttrs (name: drv: if lib.hasPrefix "bizhawkAssemblies-" name then drv else drv.assemblies or null))

0 commit comments

Comments
 (0)