about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorjoachifm <joachifm@users.noreply.github.com>2016-04-09 19:38:12 +0200
committerjoachifm <joachifm@users.noreply.github.com>2016-04-09 19:38:12 +0200
commit1d36e6ec0784e5813549ea0daaf3a565f1945d84 (patch)
treec8a0962522f5e8968cf6da31aceb6f2a181012e5 /pkgs
parent2486191f3924eef8dd92ecb1e4732f9a90357df5 (diff)
parent857cb10e1d7160012962a2323f255e0f81f5cc30 (diff)
Merge pull request #14382 from aneeshusa/update-ccache-stdenv-documentation
ccacheStdenv: provide working example config in docs
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/top-level/all-packages.nix16
1 files changed, 11 insertions, 5 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e44a3559f0add..8d844f04ccb4f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5765,16 +5765,22 @@ in
   # It can be used by setting in nixpkgs config like this, for example:
   #    replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
   # But if you build in chroot, you should have that path in chroot
-  # If instantiated directly, it will use the HOME/.ccache as cache directory.
-  # You can use an override in packageOverrides to set extraConfig:
+  # If instantiated directly, it will use $HOME/.ccache as the cache directory,
+  # i.e. /homeless-shelter/.ccache using the Nix daemon.
+  # You should specify a different directory using an override in
+  # packageOverrides to set extraConfig.
+  #
+  # Example using Nix daemon (i.e. multiuser Nix install or on NixOS):
   #    packageOverrides = pkgs: {
   #     ccacheWrapper = pkgs.ccacheWrapper.override {
   #       extraConfig = ''
-  #         CCACHE_COMPRESS=1
-  #         CCACHE_DIR=/bin/.ccache
+  #         export CCACHE_COMPRESS=1
+  #         export CCACHE_DIR=/var/cache/ccache
+  #         export CCACHE_UMASK=007
   #       '';
   #     };
-  #
+  # You can use a different directory, but whichever directory you choose
+  # should be owned by user root, group nixbld with permissions 0770.
   ccacheWrapper = makeOverridable ({ extraConfig ? "" }:
      wrapCC (ccache.links extraConfig)) {};
   ccacheStdenv = lowPrio (overrideCC stdenv ccacheWrapper);