profile-sync-daemon: 5.53 -> 6.33
This commit is contained in:
parent
bf2a90298a
commit
574f4c4069
@ -4,22 +4,7 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.psd;
|
cfg = config.services.psd;
|
||||||
|
|
||||||
configFile = ''
|
|
||||||
${optionalString (cfg.users != [ ]) ''
|
|
||||||
USERS="${concatStringsSep " " cfg.users}"
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.browsers != [ ]) ''
|
|
||||||
BROWSERS="${concatStringsSep " " cfg.browsers}"
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (cfg.volatile != "") "VOLATILE=${cfg.volatile}"}
|
|
||||||
${optionalString (cfg.daemonFile != "") "DAEMON_FILE=${cfg.daemonFile}"}
|
|
||||||
'';
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.services.psd = with types; {
|
options.services.psd = with types; {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
@ -28,32 +13,6 @@ in {
|
|||||||
Whether to enable the Profile Sync daemon.
|
Whether to enable the Profile Sync daemon.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = [ ];
|
|
||||||
example = [ "demo" ];
|
|
||||||
description = ''
|
|
||||||
A list of users whose browser profiles should be sync'd to tmpfs.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
browsers = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
default = [ ];
|
|
||||||
example = [ "chromium" "firefox" ];
|
|
||||||
description = ''
|
|
||||||
A list of browsers to sync. Available choices are:
|
|
||||||
|
|
||||||
chromium chromium-dev conkeror.mozdev.org epiphany firefox
|
|
||||||
firefox-trunk google-chrome google-chrome-beta google-chrome-unstable
|
|
||||||
heftig-aurora icecat luakit midori opera opera-developer opera-beta
|
|
||||||
qupzilla palemoon rekonq seamonkey
|
|
||||||
|
|
||||||
An empty list will enable all browsers.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
resyncTimer = mkOption {
|
resyncTimer = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = "1h";
|
default = "1h";
|
||||||
@ -66,46 +25,21 @@ in {
|
|||||||
omitted.
|
omitted.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
volatile = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "/run/psd-profiles";
|
|
||||||
description = ''
|
|
||||||
The directory where browser profiles should reside(this should be
|
|
||||||
mounted as a tmpfs). Do not include a trailing backslash.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
daemonFile = mkOption {
|
|
||||||
type = str;
|
|
||||||
default = "/run/psd";
|
|
||||||
description = ''
|
|
||||||
Where the pid and backup configuration files will be stored.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
|
||||||
{ assertion = cfg.users != [];
|
|
||||||
message = "services.psd.users must contain at least one user";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd = {
|
systemd = {
|
||||||
|
user = {
|
||||||
services = {
|
services = {
|
||||||
psd = {
|
psd = {
|
||||||
|
enable = true;
|
||||||
description = "Profile Sync daemon";
|
description = "Profile Sync daemon";
|
||||||
wants = [ "psd-resync.service" "local-fs.target" ];
|
wants = [ "psd-resync.service" "local-fs.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "default.target" ];
|
||||||
preStart = "mkdir -p ${cfg.volatile}";
|
path = with pkgs; [ rsync kmod gawk nettools profile-sync-daemon ];
|
||||||
|
|
||||||
path = with pkgs; [ glibc rsync gawk ];
|
|
||||||
|
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
RequiresMountsFor = [ "/home/" ];
|
RequiresMountsFor = [ "/home/" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = "yes";
|
RemainAfterExit = "yes";
|
||||||
@ -115,13 +49,13 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
psd-resync = {
|
psd-resync = {
|
||||||
|
enable = true;
|
||||||
description = "Timed profile resync";
|
description = "Timed profile resync";
|
||||||
after = [ "psd.service" ];
|
after = [ "psd.service" ];
|
||||||
wants = [ "psd-resync.timer" ];
|
wants = [ "psd-resync.timer" ];
|
||||||
partOf = [ "psd.service" ];
|
partOf = [ "psd.service" ];
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
path = with pkgs; [ glibc rsync gawk ];
|
path = with pkgs; [ rsync kmod gawk nettools profile-sync-daemon ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon resync";
|
ExecStart = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon resync";
|
||||||
@ -138,8 +72,6 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
environment.etc."psd.conf".text = configFile;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,24 @@
|
|||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl, utillinux}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "5.53";
|
version = "6.33";
|
||||||
name = "profile-sync-daemon-${version}";
|
name = "profile-sync-daemon-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://github.com/graysky2/profile-sync-daemon/archive/v${version}.tar.gz";
|
url = "http://github.com/graysky2/profile-sync-daemon/archive/v${version}.tar.gz";
|
||||||
sha256 = "0m7h9l7dndqgb5k3grpc00f6dpg73p6h4q5sgkf8bvyzvcbdafwx";
|
sha256 = "0dzs51xbszzmcg82n2dil6nljj4gn0aw9rqjmhyi4a5frc8g6xmb";
|
||||||
};
|
};
|
||||||
|
|
||||||
installPhase = "PREFIX=\"\" DESTDIR=$out make install-systemd-all";
|
installPhase = ''
|
||||||
|
PREFIX=\"\" DESTDIR=$out make install
|
||||||
|
substituteInPlace $out/bin/profile-sync-daemon \
|
||||||
|
--replace "/usr/" "$out/" \
|
||||||
|
--replace "sudo " "/run/wrappers/bin/sudo "
|
||||||
|
# $HOME detection fails (and is unnecessary)
|
||||||
|
sed -i '/^HOME/d' $out/bin/profile-sync-daemon
|
||||||
|
substituteInPlace $out/bin/psd-overlay-helper \
|
||||||
|
--replace "PATH=/usr/bin:/bin" "PATH=${utillinux.bin}/bin"
|
||||||
|
'';
|
||||||
|
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user