Giter VIP home page Giter VIP logo

Comments (2)

talyz avatar talyz commented on June 30, 2024

Writing HM modules for PSD and ASD and submitting them upstream would probably be preferred, since they don't depend on any of the functionality provided by impermanence. We could then implement support for automatically setting up the configuration for the relevant directories.

Just a warning before you spend any time on this, though: in my experience, the claims of increased preformance are a bit exaggerated, at least when running off an SSD. While the claims of massively decreased latency are true, it's not that noticable in reality. Just try mounting a tmpfs at ~/.mozilla and see if it lives up to your expectations first.

from impermanence.

Th3Whit3Wolf avatar Th3Whit3Wolf commented on June 30, 2024

@colemickens for the time being this can be achieved by creating a systemd service and timer with home-manager (assuming home is mounted on tmpfs).

    systemd.user = {
      # This is effectively what psd does
      services.firefox-persist = {
        Unit = {
          Description = "Firefox persistent storage sync";
        };

        Service = {
          CPUSchedulingPolicy = "idle";
          IOSchedulingClass = "idle";
          Environment = "PATH=${pkgs.coreutils}";
          # copy all files except those that are symlinks
          ExecStart = toString (pkgs.writeShellScript "firefox-backup" ''
            ${pkgs.rsync}/bin/rsync -avh --exclude={'user.js','chrome','extensions'} /home/doc/.mozilla/firefox/doc /persist/home/doc/.mozilla/firefox/
          '');
        };
      };

      timers.firefox-persist = {
        Unit = {
          Description = "Firefox persistent storage periodic sync";
        };

        Timer = {
          Unit = "firefox-persist.service";
          # Run every 15 minutes
          OnCalendar = "*:0/15";
          Persistent = true;
        };

        Install = { WantedBy = [ "timers.target" ]; };
      };
    };

I use --exclude={'user.js','chrome','extensions'} because these are symlinks in the nix store which impermanence seems to have an issue with right now.

PSD uses rsync -aX --inplace --no-whole-file

Then all you need to do is copy the files over on login.

from impermanence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.