mkg
October 1, 2019, 8:52pm
1
I have a custom theme for slim in a local file, which was working but when I went to upgrade it broke:
# nixos-rebuild switch
…
trying file:///etc/nixos/cfg/rsrc/nixos-slim-theme-dark.tar.gz
curl: (37) Couldn’t open file /etc/nixos/cfg/rsrc/nixos-slim-theme-dark.tar.gz
error: cannot download nixos-slim-theme-dark.tar.gz from any mirror
…
Yet running curl from the command line works:
# curl file:///etc/nixos/cfg/rsrc/nixos-slim-theme-dark.tar.gz > /tmp/foo
Here is the relevant part of my configuration.nix:
displayManager.slim = {
enable = true;
theme = pkgs.fetchurl {
url = "file:///etc/nixos/cfg/rsrc/nixos-slim-theme-dark.tar.gz";
sha256 = "1ac8xhvw5gv95mql7684iimqrbvxwblpiwis21v3lw3l34pyrf1n";
};
};
What should I be doing so that this works first time every time?
1 Like
ip1981
October 1, 2019, 9:23pm
2
I think it should be simply theme = /path/file.tar.gz
ip1981
October 1, 2019, 9:26pm
3
But anyway, if the build is performed by nix daemon, this file won’t be available to the deamon. To make it so it should be ${/path/file.tar.gz}
.
The ${...}
probably isn’t necessary. Just using the path literal syntax should cause it to be copied to the store, rather than refer to the original path.
ip1981
October 2, 2019, 7:52am
5
It depends (whether it’s captured in some other context), ${...}
will capture it right here for sure.
Yea, that’s why I only said “probably” The only way that wouldn’t be the case is if someone used toString
for some reason, which isn’t common.
mkg
October 3, 2019, 3:56pm
7
Thank you all. I used the simplest approach of just specifying the path as a path literal as suggested by @ip1981 . That worked.