symlinkJoin: accept set as an argument with additional options

This commit is contained in:
Nikolay Amiantov 2016-04-26 15:10:42 +03:00
parent ae8a3a14f0
commit dfe608c8a2
4 changed files with 23 additions and 8 deletions

View file

@ -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;

View file

@ -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
{

View file

@ -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}
'';

View file

@ -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 {};