···
in writeScript "gitit" ''
22
-
export PATH="${makeSearchPath "bin" (
23
-
[ git curl ] ++ (if cfg.pdfExport then [texLiveFull] else [])
export NIX_GHC="${env}/bin/ghc"
export NIX_GHCPKG="${env}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${env}/share/doc/ghc/html"
···
description = "Git and Pandoc Powered Wiki";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
624
+
path = with pkgs; [ curl ]
625
+
++ optional cfg.pdfExport texLiveFull
626
+
++ optional (cfg.repositoryType == "darcs") darcs
627
+
++ optional (cfg.repositoryType == "mercurial") mercurial
628
+
++ optional (cfg.repositoryType == "git") git;
628
-
preStart = with cfg; ''
631
+
gm = "gitit@${config.networking.hostName}";
chown ${uid}:${gid} -R ${homeDir}
for dir in ${repositoryPath} ${staticDir} ${templatesDir} ${cacheDir}
···
642
-
${pkgs.git}/bin/git init
643
-
${pkgs.git}/bin/git config user.email "gitit@${config.networking.hostName}"
644
-
${pkgs.git}/bin/git config user.name "gitit"
645
-
chown ${uid}:${gid} -R {repositoryPath}
646
+
if repositoryType == "darcs" then
650
+
${pkgs.darcs}/bin/darcs initialize
651
+
echo "${gm}" > _darcs/prefs/email
653
+
else if repositoryType == "mercurial" then
657
+
${pkgs.mercurial}/bin/hg init
658
+
cat >> .hg/hgrc <<NAMED
660
+
username = gitit ${gm}
667
+
${pkgs.git}/bin/git init
668
+
${pkgs.git}/bin/git config user.email "${gm}"
669
+
${pkgs.git}/bin/git config user.name "gitit"
671
+
chown ${uid}:${gid} -R ${repositoryPath}