nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.09k stars 80 forks source link

Systemd unit name is invalid #195

Open mrhappy200 opened 1 month ago

mrhappy200 commented 1 month ago

Uhh, this is my first time writing a Github issue without a template. Apologies if I do something wrong.

My issue is that I am getting the following error while using the impermanence home-manager module:

Error: Error switching
jul 12 20:08:17 HappyPC hm-activate-mrhappy200[1421498]: Caused by:
jul 12 20:08:17 HappyPC hm-activate-mrhappy200[1421498]:     0: Failed to perform post-reload tasks
jul 12 20:08:17 HappyPC hm-activate-mrhappy200[1421498]:     1: Failed to start unit bindMount--nix-persist-home-mrhappy200-mozilla-firefox-mrhappy200-storage-default-moz-extension+++902af220-979e-4fca-8532-df7913bed3a2-userContextId=4294967295-idb-.service
jul 12 20:08:17 HappyPC hm-activate-mrhappy200[1421498]:     2: org.freedesktop.DBus.Error.InvalidArgs: Unit name bindMount--nix-persist-home-mrhappy200-mozilla-firefox-mrhappy200-storage-default-moz-extension+++902af220-979e-4fca-8532-df7913bed3a2-userContextId=4294967295-idb-.service is not valid.

This is the nix code I am using:

home = {
    persistence = {
      "/nix/persist/home/mrhappy200/".directories = [ ".mozilla/firefox/mrhappy200/storage/default/moz-extension+++902af220-979e-4fca-8532-df7913bed3a2^userContextId=4294967295/idb/"];
    };
  };

I believe this is because the filename is too long since impermanence appears to do sanitation to remove special characters. What do I do about this? I don't see a way to change the Systemd unit name without changing the filename which isn't possible because Firefox really wants this one.