We don’t have a lot of functionality in the terragrunt built in functions that provide path manipulation, so to do what you want using pure terragrunt functions would most likely require enhancing the interpolations with another function that supports common path manipulations like basename or dirname.
That said, we recently implemented an escape hatch of sorts in the form of a run_cmd interpolation function (introduced in v0.18.2). This allows you to call out to an external program and replace the value with the stdout of the call. You can use this to implement a shell script that returns what you want (e.g in your example, the device name) given the current path.