diff options
author | Naïm Favier <n@monade.li> | 2021-10-03 18:06:03 +0200 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2021-10-04 12:47:20 +0200 |
commit | 2ddc335e6f32b875e14ad9610101325b306a0add (patch) | |
tree | 2a4591c137cb363a6ec09f529d587a10aa7a0bc7 /nixos/modules/services/misc/gitit.nix | |
parent | 330b1e08b8df4e1f0100a0a7810ec3157749e5ee (diff) | |
download | nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.gz nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.bz2 nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.lz nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.xz nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.tar.zst nixpkgs-2ddc335e6f32b875e14ad9610101325b306a0add.zip |
nixos/doc: clean up defaults and examples
Diffstat (limited to 'nixos/modules/services/misc/gitit.nix')
-rw-r--r-- | nixos/modules/services/misc/gitit.nix | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/nixos/modules/services/misc/gitit.nix b/nixos/modules/services/misc/gitit.nix index f09565283f3..ceb186c0f04 100644 --- a/nixos/modules/services/misc/gitit.nix +++ b/nixos/modules/services/misc/gitit.nix @@ -36,15 +36,15 @@ let haskellPackages = mkOption { default = pkgs.haskellPackages; - defaultText = "pkgs.haskellPackages"; - example = literalExample "pkgs.haskell.packages.ghc784"; + defaultText = literalExpression "pkgs.haskellPackages"; + example = literalExpression "pkgs.haskell.packages.ghc784"; description = "haskellPackages used to build gitit and plugins."; }; extraPackages = mkOption { type = types.functionTo (types.listOf types.package); default = self: []; - example = literalExample '' + example = literalExpression '' haskellPackages: [ haskellPackages.wreq ] @@ -665,9 +665,9 @@ in wantedBy = [ "multi-user.target" ]; path = with pkgs; [ curl ] ++ optional cfg.pdfExport texlive.combined.scheme-basic - ++ optional (cfg.repositoryType == "darcs") darcs - ++ optional (cfg.repositoryType == "mercurial") mercurial - ++ optional (cfg.repositoryType == "git") git; + ++ optional (cfg.repositoryType == "darcs") darcs + ++ optional (cfg.repositoryType == "mercurial") mercurial + ++ optional (cfg.repositoryType == "git") git; preStart = let gm = "gitit@${config.networking.hostName}"; @@ -684,35 +684,35 @@ in fi done cd ${repositoryPath} - ${ - if repositoryType == "darcs" then - '' - if [ ! -d _darcs ] - then - ${pkgs.darcs}/bin/darcs initialize - echo "${gm}" > _darcs/prefs/email - '' - else if repositoryType == "mercurial" then - '' - if [ ! -d .hg ] - then - ${pkgs.mercurial}/bin/hg init - cat >> .hg/hgrc <<NAMED + ${ + if repositoryType == "darcs" then + '' + if [ ! -d _darcs ] + then + ${pkgs.darcs}/bin/darcs initialize + echo "${gm}" > _darcs/prefs/email + '' + else if repositoryType == "mercurial" then + '' + if [ ! -d .hg ] + then + ${pkgs.mercurial}/bin/hg init + cat >> .hg/hgrc <<NAMED [ui] username = gitit ${gm} NAMED - '' - else - '' - if [ ! -d .git ] + '' + else + '' + if [ ! -d .git ] then ${pkgs.git}/bin/git init ${pkgs.git}/bin/git config user.email "${gm}" ${pkgs.git}/bin/git config user.name "gitit" - ''} + ''} chown ${uid}:${gid} -R ${repositoryPath} fi - cd - + cd - ''; serviceConfig = { |