summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2017-03-20 20:01:48 +0100
committerGitHub <noreply@github.com>2017-03-20 20:01:48 +0100
commit337f731c2b0842357ef5c94fac1a9f103e9e3189 (patch)
tree7a7ad4c1121fd08ac386b783d0cac5632a2fa57d /nixos/modules/services
parent8d8fda19b7703c134234ad3772b91480c0512afa (diff)
parent68c6d90417c5fc0d75c140e5e51e4f026cd6edff (diff)
downloadnixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar.gz
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar.bz2
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar.lz
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar.xz
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.tar.zst
nixlib-337f731c2b0842357ef5c94fac1a9f103e9e3189.zip
Merge pull request #24134 from pstn/nix-auto-optimise
Added option and description for nix store auto-optimisation.
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 5088c4e60691..fed646aadac4 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -46,6 +46,7 @@ let
         binary-caches = ${toString cfg.binaryCaches}
         trusted-binary-caches = ${toString cfg.trustedBinaryCaches}
         binary-cache-public-keys = ${toString cfg.binaryCachePublicKeys}
+        auto-optimise-store = ${toString cfg.autoOptimiseStore}
         ${optionalString cfg.requireSignedBinaryCaches ''
           signed-binary-caches = *
         ''}
@@ -86,6 +87,18 @@ in
         '';
       };
 
+      autoOptimiseStore = mkOption {
+        type = types.bool;
+        default = false;
+        example = true;
+        description = ''
+         If set to true, Nix automatically detects files in the store that have
+         identical contents, and replaces them with hard links to a single copy.
+         This saves disk space. If set to false (the default), you can still run
+         nix-store --optimise to get rid of duplicate files.
+        '';
+      };
+
       buildCores = mkOption {
         type = types.int;
         default = 1;