Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profile-sync-daemon: 5.53 -> 6.33 #46106

Merged
merged 1 commit into from Oct 6, 2018
Merged

profile-sync-daemon: 5.53 -> 6.33 #46106

merged 1 commit into from Oct 6, 2018

Conversation

NickHu
Copy link
Contributor

@NickHu NickHu commented Sep 5, 2018

Outdated package

This change is somewhat major in that the service transitioned from being a
systemd system service to a systemd user service. Hence I thought it was
appropriate to do away with the NixOS module altogether as modules are not
user-centric. I would suggest the following be used as a template, in
/etc/nixos/configuration.nix:

services.logind.extraConfig = "RuntimeDirectorySize=50%";
systemd = {
  user = {
    services = {
      psd = {
        description = "Profile Sync daemon";
        wants = [ "psd-resync.service" "local-fs.target" ];
        wantedBy = [ "multi-user.target" ];

        path = with pkgs; [ rsync kmod gawk nettools profile-sync-daemon ];

        unitConfig = {
          RequiresMountsFor = [ "/home/" ];
        };

        serviceConfig = {
          Type = "oneshot";
          RemainAfterExit = "yes";
          ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon sync";
          ExecStop = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon unsync";
        };
      };

      psd-resync = {
        description = "Timed profile resync";
        after = [ "psd.service" ];
        wants = [ "psd-resync.timer" ];
        partOf = [ "psd.service" ];

        path = with pkgs; [ rsync kmod gawk nettools profile-sync-daemon ];

        serviceConfig = {
          Type = "oneshot";
          ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon resync";
        };
      };
    };

    timers.psd-resync = {
      description = "Timer for profile sync daemon";
      partOf = [ "psd-resync.service" "psd.service" ];

      timerConfig = {
        OnUnitActiveSec = "1h";
      };
    };
  };
};

Note that the VOLATILE configuration option previously used to specify the
cache location has been deprecated (which is arguably a poor choice), and now
cache is stored in $XDG_RUNTIME_DIR. This is quite small on NixOS, so that's
what the logind line changes.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@NickHu
Copy link
Contributor Author

NickHu commented Sep 13, 2018

Actually I updated it in a similar vein to the unclutter-xfixes module, so now the above configuration is unnecessary; now it can be configured with psd.enable = true;, with resyncTimer being configurable. The rest of the configuration is not managed by the nixos module, and is done at $HOME/.config/psd/.psd.conf; recommend users also install the profile-sync-daemon package to run psd preview and psd clean to access more functionality.

@matthewbauer matthewbauer merged commit 91078ee into NixOS:master Oct 6, 2018
@NickHu NickHu deleted the psd branch October 6, 2018 10:04
devhell added a commit to openlab-aux/vuizvui that referenced this pull request Oct 6, 2018
It has been reworked in [1], and since I don't use it at the moment
there is reason to keep even the deactivated version around.

[1] NixOS/nixpkgs#46106
@srhb
Copy link
Contributor

srhb commented Oct 17, 2018

Did release notes for this land in some other PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants