``` config=$(for i in ''${XDG_CONFIG_DIRS//:/ /} ; do test -f $i/sway/config && echo $i/sway/config ; done)

  ${pkgs.sway}/bin/sway -c $config

```

I assume there's some reason you're only checking XDG_CONFIG_HOME and not XDG_CONFIG_DIRS, and I can only hope it's a good one