lol

nixos/services.gollum: remove `with lib;`

+42 -45
+42 -45
nixos/modules/services/misc/gollum.nix
··· 4 4 pkgs, 5 5 ... 6 6 }: 7 - 8 - with lib; 9 - 10 7 let 11 8 cfg = config.services.gollum; 12 9 in 13 10 14 11 { 15 12 imports = [ 16 - (mkRemovedOptionModule 13 + (lib.mkRemovedOptionModule 17 14 [ 18 15 "services" 19 16 "gollum" ··· 24 21 ]; 25 22 26 23 options.services.gollum = { 27 - enable = mkEnableOption "Gollum, a git-powered wiki service"; 24 + enable = lib.mkEnableOption "Gollum, a git-powered wiki service"; 28 25 29 - address = mkOption { 30 - type = types.str; 26 + address = lib.mkOption { 27 + type = lib.types.str; 31 28 default = "0.0.0.0"; 32 29 description = "IP address on which the web server will listen."; 33 30 }; 34 31 35 - port = mkOption { 36 - type = types.port; 32 + port = lib.mkOption { 33 + type = lib.types.port; 37 34 default = 4567; 38 35 description = "Port on which the web server will run."; 39 36 }; 40 37 41 - extraConfig = mkOption { 42 - type = types.lines; 38 + extraConfig = lib.mkOption { 39 + type = lib.types.lines; 43 40 default = ""; 44 41 description = "Content of the configuration file"; 45 42 }; 46 43 47 - math = mkOption { 48 - type = types.bool; 44 + math = lib.mkOption { 45 + type = lib.types.bool; 49 46 default = false; 50 47 description = "Enable support for math rendering using KaTeX"; 51 48 }; 52 49 53 - allowUploads = mkOption { 54 - type = types.nullOr ( 55 - types.enum [ 50 + allowUploads = lib.mkOption { 51 + type = lib.types.nullOr ( 52 + lib.types.enum [ 56 53 "dir" 57 54 "page" 58 55 ] ··· 61 58 description = "Enable uploads of external files"; 62 59 }; 63 60 64 - user-icons = mkOption { 65 - type = types.nullOr ( 66 - types.enum [ 61 + user-icons = lib.mkOption { 62 + type = lib.types.nullOr ( 63 + lib.types.enum [ 67 64 "gravatar" 68 65 "identicon" 69 66 ] ··· 72 69 description = "Enable specific user icons for history view"; 73 70 }; 74 71 75 - emoji = mkOption { 76 - type = types.bool; 72 + emoji = lib.mkOption { 73 + type = lib.types.bool; 77 74 default = false; 78 75 description = "Parse and interpret emoji tags"; 79 76 }; 80 77 81 - h1-title = mkOption { 82 - type = types.bool; 78 + h1-title = lib.mkOption { 79 + type = lib.types.bool; 83 80 default = false; 84 81 description = "Use the first h1 as page title"; 85 82 }; 86 83 87 - no-edit = mkOption { 88 - type = types.bool; 84 + no-edit = lib.mkOption { 85 + type = lib.types.bool; 89 86 default = false; 90 87 description = "Disable editing pages"; 91 88 }; 92 89 93 - local-time = mkOption { 94 - type = types.bool; 90 + local-time = lib.mkOption { 91 + type = lib.types.bool; 95 92 default = false; 96 93 description = "Use the browser's local timezone instead of the server's for displaying dates."; 97 94 }; 98 95 99 - branch = mkOption { 100 - type = types.str; 96 + branch = lib.mkOption { 97 + type = lib.types.str; 101 98 default = "master"; 102 99 example = "develop"; 103 100 description = "Git branch to serve"; 104 101 }; 105 102 106 - stateDir = mkOption { 107 - type = types.path; 103 + stateDir = lib.mkOption { 104 + type = lib.types.path; 108 105 default = "/var/lib/gollum"; 109 106 description = "Specifies the path of the repository directory. If it does not exist, Gollum will create it on startup."; 110 107 }; 111 108 112 - package = mkPackageOption pkgs "gollum" { }; 109 + package = lib.mkPackageOption pkgs "gollum" { }; 113 110 114 - user = mkOption { 115 - type = types.str; 111 + user = lib.mkOption { 112 + type = lib.types.str; 116 113 default = "gollum"; 117 114 description = "Specifies the owner of the wiki directory"; 118 115 }; 119 116 120 - group = mkOption { 121 - type = types.str; 117 + group = lib.mkOption { 118 + type = lib.types.str; 122 119 default = "gollum"; 123 120 description = "Specifies the owner group of the wiki directory"; 124 121 }; 125 122 }; 126 123 127 - config = mkIf cfg.enable { 124 + config = lib.mkIf cfg.enable { 128 125 129 - users.users.gollum = mkIf (cfg.user == "gollum") { 126 + users.users.gollum = lib.mkIf (cfg.user == "gollum") { 130 127 group = cfg.group; 131 128 description = "Gollum user"; 132 129 createHome = false; ··· 158 155 --host ${cfg.address} \ 159 156 --config ${pkgs.writeText "gollum-config.rb" cfg.extraConfig} \ 160 157 --ref ${cfg.branch} \ 161 - ${optionalString cfg.math "--math"} \ 162 - ${optionalString cfg.emoji "--emoji"} \ 163 - ${optionalString cfg.h1-title "--h1-title"} \ 164 - ${optionalString cfg.no-edit "--no-edit"} \ 165 - ${optionalString cfg.local-time "--local-time"} \ 166 - ${optionalString (cfg.allowUploads != null) "--allow-uploads ${cfg.allowUploads}"} \ 167 - ${optionalString (cfg.user-icons != null) "--user-icons ${cfg.user-icons}"} \ 158 + ${lib.optionalString cfg.math "--math"} \ 159 + ${lib.optionalString cfg.emoji "--emoji"} \ 160 + ${lib.optionalString cfg.h1-title "--h1-title"} \ 161 + ${lib.optionalString cfg.no-edit "--no-edit"} \ 162 + ${lib.optionalString cfg.local-time "--local-time"} \ 163 + ${lib.optionalString (cfg.allowUploads != null) "--allow-uploads ${cfg.allowUploads}"} \ 164 + ${lib.optionalString (cfg.user-icons != null) "--user-icons ${cfg.user-icons}"} \ 168 165 ${cfg.stateDir} 169 166 ''; 170 167 };