about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2023-02-08 16:43:39 +0100
committerGitHub <noreply@github.com>2023-02-08 16:43:39 +0100
commit10d5d6196a183b534a1b9815bbfaf0ea91e78dad (patch)
tree034176704b16bf55d22456436eca006550991c7e
parente7ee36d0b285b135c034e7e8e5978f3b0811e1ff (diff)
parent1c664befd4c198db2c6993f8afde709024bcec6d (diff)
Merge pull request #213601 from SuperSandro2000/envfs-wsl
nixos/envfs: use configured environment.usrbinenv and environment.binsh, add extraFallbackPath options
-rw-r--r--nixos/modules/tasks/filesystems/envfs.nix18
1 files changed, 13 insertions, 5 deletions
diff --git a/nixos/modules/tasks/filesystems/envfs.nix b/nixos/modules/tasks/filesystems/envfs.nix
index 450b805f0f580..76344f5f87eaf 100644
--- a/nixos/modules/tasks/filesystems/envfs.nix
+++ b/nixos/modules/tasks/filesystems/envfs.nix
@@ -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" = {
@@ -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";
       };
     };
   };