impermanence icon indicating copy to clipboard operation
impermanence copied to clipboard

feature request: add wildcard matching

Open Sntx626 opened this issue 1 year ago • 3 comments

I would like to persist all directories that follow a specific pattern.

Here's an example:

environment.persistence."/nix/persist".users."testuser" = {
  files = [
    # persist all .txt files in the directory
    ".cache/test/*.txt"
  ];
  directories = [
    # persist all extension data, do not persist website data (which is stored in the same dir)
    ".mozilla/firefox/default/storage/default/moz-extension+++*"
  ];
};

Sntx626 avatar Nov 21 '23 18:11 Sntx626

I would love to see this! What would I have to do to make this a reality @talyz?

IogaMaster avatar Jan 25 '24 22:01 IogaMaster

I've thought about it a bit more.

The only way I can think of realizing this is by creating a service for each wildcard that dynamically bindmounts matches at runtime - since we can't really know what would eventually get matched.

Since imperanence is all about "purity", would we even want to introduce such a feature?

Nonetheless, I'd love to see something like this working. Does anyone have an idea on how to solve this problem more elegantly?

Sntx626 avatar Jan 29 '24 18:01 Sntx626

I would also love to see this! When I have the time I will look into implementing it, but I cannot make that time in the immediate future.

mboyea avatar Mar 20 '24 02:03 mboyea