diff --git a/CHANGELOG.md b/CHANGELOG.md index e5482939e..22da0cabf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ IMPROVEMENTS: BUG FIXES: + - core: Windows is not detected as NixOS in some cases. [GH-4302] - core: Fix encoding issues with Windows. There are still some outlying but this fixes a few. [GH-4159] - commands/package: base package won't crash with exception [GH-4017] diff --git a/plugins/communicators/winrm/command_filters/test.rb b/plugins/communicators/winrm/command_filters/test.rb index 256b79114..bee71505d 100644 --- a/plugins/communicators/winrm/command_filters/test.rb +++ b/plugins/communicators/winrm/command_filters/test.rb @@ -8,7 +8,7 @@ module VagrantPlugins # test -f /tmp/afile # test -L /somelink # test -x /tmp/some.exe - + cmd_parts = command.strip.split(/\s+/) flag = cmd_parts[1] path = cmd_parts[2] diff --git a/plugins/guests/nixos/guest.rb b/plugins/guests/nixos/guest.rb index 5a73b6004..54b57e67a 100644 --- a/plugins/guests/nixos/guest.rb +++ b/plugins/guests/nixos/guest.rb @@ -4,6 +4,12 @@ module VagrantPlugins module GuestNixos class Guest < Vagrant.plugin("2", :guest) def detect?(machine) + # For some reason our test passes on Windows, so just short + # circuit because we're not Windows. + if machine.config.vm.communicator == :winrm + return false + end + machine.communicate.test("test -f /run/current-system/nixos-version") end end