Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ba56744abdd9
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 19cb786b9aa9
Choose a head ref
  • 16 commits
  • 16 files changed
  • 6 contributors

Commits on Apr 22, 2019

  1. automysqlinit: init at 3.0_rc6

    (cherry picked from commit 5f4df8e)
    aanderse committed Apr 22, 2019
    Copy the full SHA
    dba66e2 View commit details
  2. perl: add .withPackages

    (cherry picked from commit 03eaa48)
    volth authored and samueldr committed Apr 22, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    246f5a5 View commit details
  3. perl.pkgs.Encode: fix buildEnv collision with perl

    fix NixOS/nixpkgs#59215 (comment)
    
    (cherry picked from commit f73eb61)
    volth authored and samueldr committed Apr 22, 2019
    Copy the full SHA
    a13cab4 View commit details
  4. perl.pkgs.Encode: fix typo

    (cherry picked from commit d23ff47)
    volth authored and samueldr committed Apr 22, 2019
    Copy the full SHA
    0b42d3c View commit details
  5. perl.meta.priority += 1

    give priority to perl libraries when they meet the perl derivation in `buildEnv`.
    
    The notable case is `buildEnv` inside `perl.withPackages`.
    
    The `perl' derivation includes obsolete versions of some CPAN packages
    which leads to collissions when there are newer versions
    of the same libraries are on the right hand side
    of `perl.withPackages` (perhaps indirectly).
    
    Fixes #60025
    
    (cherry picked from commit 0fad0b4)
    volth authored and samueldr committed Apr 22, 2019
    Copy the full SHA
    32be67f View commit details
  6. Copy the full SHA
    5dd001a View commit details
  7. Merge pull request #60033 from aanderse/automysqlbackup-backport

    automysqlinit: init at 3.0_rc6 (19.03 backport)
    infinisil authored Apr 22, 2019
    Copy the full SHA
    c19fad4 View commit details
  8. libplist: 2018-07-25 -> 2019-01-20

    (cherry picked from commit 7634357)
    dtzWill authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    5b080ed View commit details
  9. libusbmuxd: 2018-07-23 -> 2019-01-18

    (cherry picked from commit 668f759)
    dtzWill authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    b4a42a9 View commit details
  10. libplist 2019-01-20 -> 2019-04-04

    (cherry picked from commit 2013c91)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    9956d1c View commit details
  11. libusbmuxd: 2019-01-18 -> 2019-03-23

    (cherry picked from commit dd03b21)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    ece4bde View commit details
  12. libimobiledevice: 2018-07-24 -> 2019-04-04

    (cherry picked from commit 173e960)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    155513d View commit details
  13. usbmuxd: 2018-10-10 -> 2019-03-05

    (cherry picked from commit 71c1b44)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    4274fae View commit details
  14. ifuse: 1.1.3 -> 2018-10-08

    Switching to latest master, as there hasn't been a new release in a
    while, see libimobiledevice/ifuse#34
    
    (cherry picked from commit 8d5252b)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    e45f427 View commit details
  15. ideviceinstaller: 2018-06-01 -> 2018-10-01

    (cherry picked from commit 768e9b1)
    infinisil authored and worldofpeace committed Apr 22, 2019
    Copy the full SHA
    ae8b274 View commit details
  16. Merge pull request #60037 from samueldr/backport/nixpkgs-59215

    Backport perl: add .withPackages #59215 #60028
    samueldr authored Apr 22, 2019
    Copy the full SHA
    19cb786 View commit details
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -184,6 +184,7 @@
./services/audio/slimserver.nix
./services/audio/squeezelite.nix
./services/audio/ympd.nix
./services/backup/automysqlbackup.nix
./services/backup/bacula.nix
./services/backup/borgbackup.nix
./services/backup/duplicati.nix
115 changes: 115 additions & 0 deletions nixos/modules/services/backup/automysqlbackup.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{ config, lib, pkgs, ... }:

let

inherit (lib) concatMapStringsSep concatStringsSep isInt isList literalExample;
inherit (lib) mapAttrs mapAttrsToList mkDefault mkEnableOption mkIf mkOption optional types;

cfg = config.services.automysqlbackup;
pkg = pkgs.automysqlbackup;
user = "automysqlbackup";
group = "automysqlbackup";

toStr = val:
if isList val then "( ${concatMapStringsSep " " (val: "'${val}'") val} )"
else if isInt val then toString val
else if true == val then "'yes'"
else if false == val then "'no'"
else "'${toString val}'";

configFile = pkgs.writeText "automysqlbackup.conf" ''
#version=${pkg.version}
# DONT'T REMOVE THE PREVIOUS VERSION LINE!
#
${concatStringsSep "\n" (mapAttrsToList (name: value: "CONFIG_${name}=${toStr value}") cfg.config)}
'';

in
{
# interface
options = {
services.automysqlbackup = {

enable = mkEnableOption "AutoMySQLBackup";

calendar = mkOption {
type = types.str;
default = "01:15:00";
description = ''
Configured when to run the backup service systemd unit (DayOfWeek Year-Month-Day Hour:Minute:Second).
'';
};

config = mkOption {
type = with types; attrsOf (either (either str (either int bool)) (listOf str));
default = {};
description = ''
automysqlbackup configuration. Refer to
<filename>''${pkgs.automysqlbackup}/etc/automysqlbackup.conf</filename>
for details on supported values.
'';
example = literalExample ''
{
db_names = [ "nextcloud" "matomo" ];
table_exclude = [ "nextcloud.oc_users" "nextcloud.oc_whats_new" ];
mailcontent = "log";
mail_address = "admin@example.org";
}
'';
};

};
};

# implementation
config = mkIf cfg.enable {

assertions = [
{ assertion = !config.services.mysqlBackup.enable;
message = "Please choose one of services.mysqlBackup or services.automysqlbackup.";
}
];

services.automysqlbackup.config = mapAttrs (name: mkDefault) {
mysql_dump_username = user;
mysql_dump_host = "localhost";
backup_dir = "/var/backup/mysql";
db_exclude = [ "information_schema" "performance_schema" ];
mailcontent = "stdout";
mysql_dump_single_transaction = true;
};

systemd.timers.automysqlbackup = {
description = "automysqlbackup timer";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = cfg.calendar;
AccuracySec = "5m";
};
};

systemd.services.automysqlbackup = {
description = "automysqlbackup service";
serviceConfig = {
User = user;
Group = group;
ExecStart = "${pkg}/bin/automysqlbackup ${configFile}";
};
};

environment.systemPackages = [ pkg ];

users.users.${user}.group = group;
users.groups.${group} = { };

systemd.tmpfiles.rules = [
"d '${cfg.config.backup_dir}' 0750 ${user} ${group} - -"
];

services.mysql.ensureUsers = optional (config.services.mysql.enable && cfg.config.mysql_dump_host == "localhost") {
name = user;
ensurePermissions = { "*.*" = "SELECT, SHOW VIEW, TRIGGER, LOCK TABLES"; };
};

};
}
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ in
{
acme = handleTestOn ["x86_64-linux"] ./acme.nix {};
atd = handleTest ./atd.nix {};
automysqlbackup = handleTest ./automysqlbackup.nix {};
avahi = handleTest ./avahi.nix {};
bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64
beanstalkd = handleTest ./beanstalkd.nix {};
34 changes: 34 additions & 0 deletions nixos/tests/automysqlbackup.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import ./make-test.nix ({ pkgs, lib, ... }:

{
name = "automysqlbackup";
meta.maintainers = [ lib.maintainers.aanderse ];

machine =
{ pkgs, ... }:
{
services.mysql.enable = true;
services.mysql.package = pkgs.mysql;
services.mysql.initialDatabases = [ { name = "testdb"; schema = ./testdb.sql; } ];

services.automysqlbackup.enable = true;
};

testScript = ''
startAll;
# Need to have mysql started so that it can be populated with data.
$machine->waitForUnit("mysql.service");
# Wait for testdb to be fully populated (5 rows).
$machine->waitUntilSucceeds("mysql -u root -D testdb -N -B -e 'select count(id) from tests' | grep -q 5");
# Do a backup and wait for it to start
$machine->startJob("automysqlbackup.service");
$machine->waitForJob("automysqlbackup.service");
# wait for backup file and check that data appears in backup
$machine->waitForFile("/var/backup/mysql/daily/testdb");
$machine->succeed("${pkgs.gzip}/bin/zcat /var/backup/mysql/daily/testdb/daily_testdb_*.sql.gz | grep hello");
'';
})
22 changes: 19 additions & 3 deletions pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, buildPackages
{ config, lib, stdenv, fetchurl, buildPackages, callPackage
, enableThreading ? stdenv ? glibc, makeWrapper
}:

@@ -22,7 +22,8 @@ let
libcInc = lib.getDev libc;
libcLib = lib.getLib libc;
crossCompiling = stdenv.buildPlatform != stdenv.hostPlatform;
common = { version, sha256 }: stdenv.mkDerivation (rec {

common = { self, version, sha256 }: stdenv.mkDerivation (rec {
inherit version;

name = "perl-${version}";
@@ -104,7 +105,19 @@ let

setupHook = ./setup-hook.sh;

passthru.libPrefix = "lib/perl5/site_perl";
passthru = rec {
interpreter = "${self}/bin/perl";
libPrefix = "lib/perl5/site_perl";
pkgs = callPackage ../../../top-level/perl-packages.nix {
perl = self;
overrides = config.perlPackageOverrides or (p: {}); # TODO: (self: super: {}) like in python
};
buildEnv = callPackage ./wrapper.nix {
perl = self;
inherit (pkgs) requiredPerlModules;
};
withPackages = f: buildEnv.override { extraLibs = f pkgs; };
};

doCheck = false; # some tests fail, expensive

@@ -155,6 +168,7 @@ let
license = licenses.artistic1;
maintainers = [ maintainers.eelco ];
platforms = platforms.all;
priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl`
};
} // stdenv.lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec {
crossVersion = "276849e62f472c1b241d9e7b38a28e4cc9f98563"; # Dez 02, 2018
@@ -179,12 +193,14 @@ let
in rec {
# the latest Maint version
perl528 = common {
self = perl528;
version = "5.28.1";
sha256 = "0iy3as4hnbjfyws4in3j9d6zhhjxgl5m95i5n9jy2bnzcpz8bgry";
};

# the latest Devel version
perldevel = common {
self = perldevel;
version = "5.29.6";
sha256 = "0wj2bia8s30788f69mf5s533l72zbhqpdr85kkk97yrh1c9sgcd6";
};
55 changes: 55 additions & 0 deletions pkgs/development/interpreters/perl/wrapper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ stdenv, perl, buildEnv, makeWrapper
, extraLibs ? []
, extraOutputsToInstall ? []
, postBuild ? ""
, ignoreCollisions ? false
, lib
, requiredPerlModules
, makeWrapperArgs ? []
}:

# Create a perl executable that knows about additional packages.
let
env = let
paths = requiredPerlModules (extraLibs ++ [ perl ] );
in buildEnv {
name = "${perl.name}-env";

inherit paths;
inherit ignoreCollisions;
extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;

# we create wrapper for the binaries in the different packages
postBuild = ''
. "${makeWrapper}/nix-support/setup-hook"
if [ -L "$out/bin" ]; then
unlink "$out/bin"
fi
mkdir -p "$out/bin"
# take every binary from perl packages and put them into the env
for path in ${stdenv.lib.concatStringsSep " " paths}; do
if [ -d "$path/bin" ]; then
cd "$path/bin"
for prg in *; do
if [ -f "$prg" ]; then
rm -f "$out/bin/$prg"
if [ -x "$prg" ]; then
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PERL5LIB "$out/${perl.libPrefix}"
fi
fi
done
fi
done
'' + postBuild;

meta = perl.meta // { outputsToInstall = ["out"]; }; # remove "man" from meta.outputsToInstall. pkgs.buildEnv produces no "man", it puts everything to "out"

passthru = perl.passthru // {
interpreter = "${env}/bin/perl";
inherit perl;
};
};
in env
8 changes: 4 additions & 4 deletions pkgs/development/libraries/libimobiledevice/default.nix
Original file line number Diff line number Diff line change
@@ -3,15 +3,15 @@

stdenv.mkDerivation rec {
pname = "libimobiledevice";
version = "2018-07-24";
version = "2019-04-04";

name = "${pname}-${version}";

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "d7a2e04d2e7880c56116fd35489a7f98755501b7";
sha256 = "0cj0j10lmfr28c7nh79n2mcmy31xx50g93h0bqs0l7y76ph4dqkc";
rev = "eea4f1be9107c8ab621fd71460e47d0d38e55d71";
sha256 = "0wh6z5f5znlqs0grh7c8jj1s411azgyy45klmql5kj3p8qqybqrs";
};

outputs = [ "out" "dev" ];
@@ -56,6 +56,6 @@ stdenv.mkDerivation rec {
'';
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ infinisil ];
};
}
8 changes: 4 additions & 4 deletions pkgs/development/libraries/libplist/default.nix
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ let
in
stdenv.mkDerivation rec {
pname = "libplist";
version = "2018-07-25";
version = "2019-04-04";

name = "${pname}-${version}";

src = fetchFromGitHub {
owner = "libimobiledevice";
repo = pname;
rev = "db68a9d1070b363eee93147f072f46526064acbc";
sha256 = "0lxyb35jjg31m8dxhsv1jr2ccy5s19fsqzisy7lfjk46w7brs4h5";
rev = "42bb64ba966082b440cb68cbdadf317f44710017";
sha256 = "19yw80yblq29i2jx9yb7bx0lfychy9dncri3fk4as35kq5bf26i8";
};

outputs = ["bin" "dev" "out" "py"];
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
description = "A library to handle Apple Property List format in binary or XML";
homepage = https://github.com/libimobiledevice/libplist;
license = licenses.lgpl21Plus;
maintainers = [ ];
maintainers = with maintainers; [ infinisil ];
platforms = platforms.linux;
};
}
8 changes: 4 additions & 4 deletions pkgs/development/libraries/libusbmuxd/default.nix
Original file line number Diff line number Diff line change
@@ -2,15 +2,15 @@

stdenv.mkDerivation rec {
pname = "libusbmuxd";
version = "2018-07-23";
version = "2019-03-23";

name = "${pname}-${version}";

src = fetchFromGitHub {
owner = "libimobiledevice";
repo = pname;
rev = "78df9be5fc8222ed53846cb553de9b5d24c85c6c";
sha256 = "05hbn0mbmv5ln9hfsvnf7i1mnp6ncbyfnl5w331kg4fi12wjshc5";
rev = "873252dc8b4e469c7dc692064ac616104fca5f65";
sha256 = "0qx3q0n1f2ajfm3vnairikayzln6iyb2y0i7sqfl8mj45ahl6wyj";
};

nativeBuildInputs = [ autoreconfHook pkgconfig ];
@@ -21,6 +21,6 @@ stdenv.mkDerivation rec {
homepage = https://github.com/libimobiledevice/libusbmuxd;
license = licenses.lgpl21Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
maintainers = with maintainers; [ infinisil ];
};
}
6 changes: 3 additions & 3 deletions pkgs/development/perl-modules/generic/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ lib, stdenv, perl }:
{ lib, stdenv, perl, toPerlModule }:

{ nativeBuildInputs ? [], name, ... } @ attrs:

stdenv.mkDerivation (
toPerlModule(stdenv.mkDerivation (
(
lib.recursiveUpdate
{
@@ -39,4 +39,4 @@ stdenv.mkDerivation (
nativeBuildInputs = nativeBuildInputs ++ [ (perl.dev or perl) ];
inherit perl;
}
)
))
Loading