Declare path dynamically

I want to import this path

modules = [ ./hosts/${host} { networking.hostName = host; } ];

but I receive anerror: path ‘./hosts/’ has a trailing slash. Converting to a string gives string './hosts/orca' doesn't represent an absolute path how do I solve this?

Oh, got it ./. + "/desktop-${desktop}.nix

1 Like