Frontear / dotfiles

Configurations that power my NixOS systems
2 stars 0 forks source link

Reduce persistence workload #9

Closed Frontear closed 3 weeks ago

Frontear commented 1 month ago

Right now persistence attempts to link everything, regardless of whether something else may have done it for them. What do I mean? Consider the current snippets in my configuration:

# user config
{
  my.persist.directories = [
    "~/.config/ArmCord"
  ];
}

# elsewhere, in user config
{
  my.persist.directories = [
    "~/.config"
  ];
}

Persisting ~/.config would effectively persist ~/.config/ArmCord, however because of the our script works, the links are:

1) processed in random order, leading to race conditions (something which has happened before) 2) forced on top of an existing link, which is undefined (or at least unknown to me)

The 2nd point especially makes me feel that it's a bit dangerous to keep this implementation as-is. It would be beneficial to cleanup the directories within the module itself, so when the list reaches the script, it has less to worry about.