Merge pull request #20356 from gnidorah/master3

yandex-disk: 0.1.5.948 -> 0.1.5.978, yandex-disk service: add exclude-dirs option
This commit is contained in:
Arseniy Seroka 2016-11-12 12:38:33 +03:00 committed by GitHub
commit 1c3b496f0d
2 changed files with 14 additions and 5 deletions

View file

@ -55,6 +55,15 @@ in
description = "The directory to use for Yandex.Disk storage";
};
excludes = mkOption {
default = "";
type = types.string;
example = "data,backup";
description = ''
Comma-separated list of directories which are excluded from synchronization.
'';
};
};
};
@ -86,7 +95,7 @@ in
chown ${u} ${dir}
if ! test -d "${cfg.directory}" ; then
mkdir -p -m 755 ${cfg.directory} ||
(mkdir -p -m 755 ${cfg.directory} && chown ${u} ${cfg.directory}) ||
exit 1
fi
@ -94,7 +103,7 @@ in
-c '${pkgs.yandex-disk}/bin/yandex-disk token -p ${cfg.password} ${cfg.username} ${dir}/token'
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${u} \
-c '${pkgs.yandex-disk}/bin/yandex-disk start --no-daemon -a ${dir}/token -d ${cfg.directory}'
-c '${pkgs.yandex-disk}/bin/yandex-disk start --no-daemon -a ${dir}/token -d ${cfg.directory} --exclude-dirs=${cfg.excludes}'
'';
};

View file

@ -6,18 +6,18 @@ let
p = if stdenv.is64bit then {
arch = "x86_64";
gcclib = "${stdenv.cc.cc.lib}/lib64";
sha256 = "0k05ybvnv0zx4vfx55jyhia38qqysaj68mapq0gwgf74k3a943g2";
sha256 = "1skbzmrcjbw00a3jnbl2llqwz3ahsgvq74mjav68s2hw1wjidvk6";
}
else {
arch = "i386";
gcclib = "${stdenv.cc.cc.lib}/lib";
sha256 = "09z9idmp7idcq0alwkla9kal9h82dx11jqh678lc4rviqggxzxhp";
sha256 = "09h71i3k9d24ki81jdwhnav63fqbc44glbx228s9g3cr4ap41jcx";
};
in
stdenv.mkDerivation rec {
name = "yandex-disk-${version}";
version = "0.1.5.948";
version = "0.1.5.978";
src = fetchurl {
url = "http://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${name}-1.fedora.${p.arch}.rpm";