Skip to content

Commit 0c872da

Browse files
committed
fix: shells test
1 parent 1638486 commit 0c872da

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

modules/wsl-distro.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ in
8080
"resolv.conf".enable = false;
8181
})
8282
];
83+
84+
systemPackages = [
85+
(pkgs.runCommand "wslpath" { } ''
86+
mkdir -p $out/bin
87+
ln -s /init $out/bin/wslpath
88+
'')
89+
];
8390
};
8491

8592
# dhcp is handled by windows

tests/shells.Tests.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ Describe "Shells" {
99
function Add-ShellTest([string]$package, [string]$executable) {
1010
$temp = New-TemporaryFile
1111
@"
12-
{ pkgs, config, ... }:
13-
{
14-
imports = [ ./base.nix ];
12+
{ pkgs, lib, config, options, ... }:
13+
with lib; {
14+
imports = [ ./base.nix ];
1515
16-
users.users.`${config.wsl.defaultUser}.shell = pkgs.$package;
16+
config = mkMerge [
17+
{ users.users.`${config.wsl.defaultUser}.shell = pkgs.$package; }
18+
(optionalAttrs (hasAttrByPath ["programs" "$package" "enable"] options) {
19+
programs.$package.enable = true;
20+
})
21+
];
1722
}
1823
"@ > $temp
1924
$distro.InstallConfig($temp)

0 commit comments

Comments
 (0)