File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ function Remove-Escapes {
1515 }
1616}
1717
18- # Implementation-independent base class
1918class Distro {
2019 [string ]$id
2120 [string ]$tempdir
Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ Describe "Login Shell" {
1414 $output | Select-Object - Index ($output.Length - 2 ) | Should -Match " login_shell\s*on"
1515 }
1616
17- It " should be possible to access home manager sessionVariables " {
17+ It " should be possible to install a configuration that uses home- manager session variables " {
1818 $distro.InstallConfig (" $PSScriptRoot /session-variables.nix" , " switch" )
19+ }
1920
20- # Session variable file should exist
21+ It " should have created the hm-session-vars.sh file" {
2122 $distro.Launch (" test -f ~/.nix-profile/etc/profile.d/hm-session-vars.sh" )
2223 $LASTEXITCODE | Should - Be 0
24+ }
2325
26+ It " should be possible to access home manager sessionVariables in bash" {
2427 Write-Host " > echo `$ TEST_VARIABLE"
2528 Write-Output " echo `$ TEST_VARIABLE" | wsl - d $distro.id | Tee-Object - Variable output | Write-Host
2629 $output | Select-Object - Last 1 | Should - BeExactly " THISISATESTSTRING"
Original file line number Diff line number Diff line change 11{ pkgs , lib , ... } :
22let
33 ver = with lib ; substring 0 5 version ;
4+ hmBranch =
5+ let
6+ # Use the nix parser conveniently built into nix
7+ flake = import <nixos-wsl/flake.nix> ;
8+ url = flake . inputs . nixpkgs . url ;
9+ version = lib . removePrefix "github:NixOS/nixpkgs/nixos-" url ;
10+ in
11+ if version == "unstable"
12+ then "master"
13+ else "release-" + version ;
414in
515{
616 imports = [
717 <nixos-wsl/modules>
8- "${ builtins . fetchTarball "https://github.com/nix-community/home-manager/archive/release- ${ ver } .tar.gz" } /nixos"
18+ "${ builtins . fetchTarball "https://github.com/nix-community/home-manager/archive/${ hmBranch } .tar.gz" } /nixos"
919 ] ;
1020
1121 wsl . enable = true ;
You can’t perform that action at this time.
0 commit comments