File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ BeforeAll {
2+ . $PSScriptRoot / ../ lib/ lib.ps1
3+ }
4+
5+ Describe " envfs" {
6+ BeforeAll {
7+ $distro = [Distro ]::new()
8+ }
9+
10+ It " should install" {
11+ $distro.InstallConfig (" $PSScriptRoot /envfs.nix" , " switch" )
12+ }
13+
14+ It " should not break the distro" {
15+ $distro.Launch (" true" )
16+ $LASTEXITCODE | Should - Be 0
17+ }
18+
19+ It " should allow running scripts with #!/bin/python3 instead of #!/usr/bin/env python3" {
20+ $distro.Launch (" echo '#!/bin/python3' > ~/test.py" )
21+ $LASTEXITCODE | Should - Be 0
22+
23+ $distro.Launch (" echo print(`" hello`" ) >> ~/test.py" )
24+ $LASTEXITCODE | Should - Be 0
25+
26+ $distro.Launch (" chmod +x ~/test.py" )
27+ $LASTEXITCODE | Should - Be 0
28+
29+ $output = $distro.Launch (" ~/test.py" ) | Select-Object - Last 1
30+ $output | Should - BeExactly " hello"
31+ $LASTEXITCODE | Should - Be 0
32+ }
33+
34+ AfterAll {
35+ $distro.Uninstall ()
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ { lib , pkgs , ... } :
2+ with lib ; {
3+ imports = [
4+ <nixos-wsl/modules>
5+ ] ;
6+
7+ config = {
8+ wsl . enable = true ;
9+ services . envfs . enable = true ;
10+
11+ environment . systemPackages = [
12+ pkgs . python3
13+ ] ;
14+ } ;
15+ }
You can’t perform that action at this time.
0 commit comments