summary refs log tree commit diff
path: root/nixos/modules/services/misc/gitit.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-28 10:25:31 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-28 10:25:31 +0200
commit99750d89dd962cc7011b02e487ed1a38c7842524 (patch)
treebdb67f8e0c047006ee26b5a2d1e53466f5307347 /nixos/modules/services/misc/gitit.nix
parentfba4a950685023bc792422665b2dbe9934ebc9c6 (diff)
downloadnixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar.gz
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar.bz2
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar.lz
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar.xz
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.tar.zst
nixlib-99750d89dd962cc7011b02e487ed1a38c7842524.zip
Don't evaluate haskellPackages when gitit is disabled
This cuts evaluation time of my NixOS configuration from 1.76s to
1.36s, and RSS from 443 MiB to 368 MiB.

Issue #8152.
Diffstat (limited to 'nixos/modules/services/misc/gitit.nix')
-rw-r--r--nixos/modules/services/misc/gitit.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/nixos/modules/services/misc/gitit.nix b/nixos/modules/services/misc/gitit.nix
index 56e735d7356b..72b706ddc5ae 100644
--- a/nixos/modules/services/misc/gitit.nix
+++ b/nixos/modules/services/misc/gitit.nix
@@ -40,7 +40,6 @@ let
       };
 
       haskellPackages = mkOption {
-        default = pkgs.haskellPackages;
         defaultText = "pkgs.haskellPackages";
         example = literalExample "pkgs.haskell.packages.ghc784";
         description = "haskellPackages used to build gitit and plugins.";
@@ -143,7 +142,6 @@ let
 
       staticDir = mkOption {
         type = types.path;
-        default = gititShared + "/data/static";
         description = ''
           Specifies the path of the static directory (containing javascript,
           css, and images).  If it does not exist, gitit will create it and
@@ -214,7 +212,6 @@ let
 
       templatesDir = mkOption {
         type = types.path;
-        default = gititShared + "/data/templates";
         description = ''
           Specifies the path of the directory containing page templates.  If it
           does not exist, gitit will create it with default templates.  Users
@@ -296,7 +293,6 @@ let
 
       plugins = mkOption {
         type = types.path;
-        default = gititShared + "/plugins/Dot.hs";
         description = ''
           Specifies a list of plugins to load.  Plugins may be specified either
           by their path or by their module name.  If the plugin name starts
@@ -608,6 +604,13 @@ in
 
   config = mkIf cfg.enable {
 
+    services.gitit = {
+      haskellPackages = mkDefault pkgs.haskellPackages;
+      staticDir = gititShared + "/data/static";
+      templatesDir = gititShared + "/data/templates";
+      plugins = gititShared + "/plugins/Dot.hs";
+    };
+
     users.extraUsers.gitit = {
       group = config.users.extraGroups.gitit.name;
       description = "Gitit user";