Skip to content

Commit

Permalink
Merge pull request #213601 from SuperSandro2000/envfs-wsl
Browse files Browse the repository at this point in the history
nixos/envfs: use configured environment.usrbinenv and environment.binsh, add extraFallbackPath options
  • Loading branch information
Mic92 committed Feb 8, 2023
2 parents e7ee36d + 1c664be commit 10d5d61
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions nixos/modules/tasks/filesystems/envfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ let
device = "none";
fsType = "envfs";
options = [
"fallback-path=${pkgs.runCommand "fallback-path" {} ''
"fallback-path=${pkgs.runCommand "fallback-path" {} (''
mkdir -p $out
ln -s ${pkgs.coreutils}/bin/env $out/env
ln -s ${config.system.build.binsh}/bin/sh $out/sh
''}"
ln -s ${config.environment.usrbinenv} $out/env
ln -s ${config.environment.binsh} $out/sh
'' + cfg.extraFallbackPathCommands)}"
];
};
"/bin" = {
Expand All @@ -31,11 +31,19 @@ in {
etc.
'';
};

package = lib.mkOption {
type = lib.types.package;
description = lib.mdDoc "Which package to use for the envfs.";
default = pkgs.envfs;
defaultText = lib.literalExpression "pkgs.envfs";
description = lib.mdDoc "Which package to use for the envfs.";
};

extraFallbackPathCommands = lib.mkOption {
type = lib.types.lines;
default = "";
example = "ln -s $''{pkgs.bash}/bin/bash $out/bash";
description = lib.mdDoc "Extra commands to run in the package that contains fallback executables in case not other executable is found";
};
};
};
Expand Down

0 comments on commit 10d5d61

Please sign in to comment.