I want to use a single file from the internet as a parameter for the command in a systemd service. Can I use fetchurl to do that? I.e.:
fetchurl
let myFile = fetchurl { url = "foo.com/file.conf"; }; in systemd.services.foo = { script = '' foo -i ${file} ''; }
But that returns a .drv file. How do I get to the file from the URL?
.drv
The answer seems to be file.outPath
file.outPath
Uhh no. "${foo}" is exactly the same as foo.outPath or "${foo.outPath}". But note that you used file while your variable was named myFile, and file is in fact the name of a package in pkgs, in case you’ve used with pkgs;
"${foo}"
foo.outPath
"${foo.outPath}"
file
myFile
with pkgs;
Whoops thats right. I meant to write myFile there. The entire thing is supposed to be entirely hypothetical.