From dfe608c8a2ecfdf0ab2838a967440207250a0b95 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 26 Apr 2016 15:10:42 +0300 Subject: [PATCH] symlinkJoin: accept set as an argument with additional options --- nixos/modules/services/logging/logcheck.nix | 5 ++++- nixos/modules/services/mail/dovecot.nix | 6 ++++-- pkgs/build-support/trivial-builders.nix | 14 +++++++++++--- pkgs/desktops/kde-5/plasma-5.5/default.nix | 6 ++++-- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/logging/logcheck.nix b/nixos/modules/services/logging/logcheck.nix index 6069262b4705..3a85fa60fe7a 100644 --- a/nixos/modules/services/logging/logcheck.nix +++ b/nixos/modules/services/logging/logcheck.nix @@ -11,7 +11,10 @@ let rm $out/logcheck.* ''; - rulesDir = pkgs.symlinkJoin "logcheck-rules-dir" ([ defaultRules ] ++ cfg.extraRulesDirs); + rulesDir = pkgs.symlinkJoin + { name = "logcheck-rules-dir"; + paths = ([ defaultRules ] ++ cfg.extraRulesDirs); + }; configFile = pkgs.writeText "logcheck.conf" cfg.config; diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix index 127c3da69d14..47e374d8edc3 100644 --- a/nixos/modules/services/mail/dovecot.nix +++ b/nixos/modules/services/mail/dovecot.nix @@ -63,8 +63,10 @@ let cfg.extraConfig ]; - modulesDir = pkgs.symlinkJoin "dovecot-modules" - (map (pkg: "${pkg}/lib/dovecot") ([ dovecotPkg ] ++ map (module: module.override { dovecot = dovecotPkg; }) cfg.modules)); + modulesDir = pkgs.symlinkJoin { + name = "dovecot-modules"; + paths = map (pkg: "${pkg}/lib/dovecot") ([ dovecotPkg ] ++ map (module: module.override { dovecot = dovecotPkg; }) cfg.modules); + }; in { diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index fef91e1d89dc..b0040cf18177 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -47,16 +47,24 @@ rec { # Create a forest of symlinks to the files in `paths'. - symlinkJoin = name: paths: + symlinkJoin = + { name + , paths + , preferLocalBuild ? true + , allowSubstitutes ? false + , postBuild ? "" + , buildInputs ? [] + , meta ? {} + }: runCommand name - { inherit paths; - preferLocalBuild = true; allowSubstitutes = false; + { inherit paths preferLocalBuild allowSubstitutes buildInputs meta; } '' mkdir -p $out for i in $paths; do ${lndir}/bin/lndir $i $out done + ${postBuild} ''; diff --git a/pkgs/desktops/kde-5/plasma-5.5/default.nix b/pkgs/desktops/kde-5/plasma-5.5/default.nix index a4f5c7c23204..3921f93a41d1 100644 --- a/pkgs/desktops/kde-5/plasma-5.5/default.nix +++ b/pkgs/desktops/kde-5/plasma-5.5/default.nix @@ -51,8 +51,10 @@ let let version = (builtins.parseDrvName breeze-qt5.name).version; in - symlinkJoin "breeze-${version}" - (map (pkg: pkg.out or pkg) [ breeze-gtk breeze-qt4 breeze-qt5 ]); + symlinkJoin { + name = "breeze-${version}"; + paths = map (pkg: pkg.out or pkg) [ breeze-gtk breeze-qt4 breeze-qt5 ]; + }; kde-cli-tools = callPackage ./kde-cli-tools.nix {}; kde-gtk-config = callPackage ./kde-gtk-config {}; kdecoration = callPackage ./kdecoration.nix {};