dotter icon indicating copy to clipboard operation
dotter copied to clipboard

Conditional include based on OS

Open Firehawke opened this issue 1 year ago • 0 comments

Environment

If applicable, provide the following details:

  • OS: Windows 11 with Ubuntu and NixOS on WSL2
  • Dotter version: 0.13.0

The question

Since I have the same hostname on Windows and WSL, I'm trying to work out how to conditionally include the windows.toml only when running in Windows. This would be the first step in having it only install the Windows Terminal configuration files when run from Windows and ignore it when from any WSL2 distro.

I've tried using the following in the hostname toml file, and it didn't work, as it doesn't seem to like templating at that level. Any suggestions?

{{#if (eq dotter.os windows)}}includes = [".dotter/windows.toml"]{{/if}}
packages = ["windowsterminalpreview"]

Firehawke avatar May 14 '24 01:05 Firehawke