···11-{ config, lib, pkgs, ... }:
22-33-with lib;
44-55-let
66-77- cfg = config.services.gitit;
88-99- homeDir = "/var/lib/gitit";
1010-1111- toYesNo = b: if b then "yes" else "no";
1212-1313- gititShared = with cfg.haskellPackages; gitit + "/share/" + ghc.targetPrefix + ghc.haskellCompilerName + "/" + gitit.pname + "-" + gitit.version;
1414-1515- gititWithPkgs = hsPkgs: extras: hsPkgs.ghcWithPackages (self: with self; [ gitit ] ++ (extras self));
1616-1717- gititSh = hsPkgs: extras: with pkgs; let
1818- env = gititWithPkgs hsPkgs extras;
1919- in writeScript "gitit" ''
2020- #!${runtimeShell}
2121- cd $HOME
2222- export NIX_GHC="${env}/bin/ghc"
2323- export NIX_GHCPKG="${env}/bin/ghc-pkg"
2424- export NIX_GHC_DOCDIR="${env}/share/doc/ghc/html"
2525- export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir )
2626- ${env}/bin/gitit -f ${configFile}
2727- '';
2828-2929- gititOptions = {
3030-3131- enable = mkOption {
3232- type = types.bool;
3333- default = false;
3434- description = lib.mdDoc "Enable the gitit service.";
3535- };
3636-3737- haskellPackages = mkOption {
3838- default = pkgs.haskellPackages;
3939- defaultText = literalExpression "pkgs.haskellPackages";
4040- example = literalExpression "pkgs.haskell.packages.ghc784";
4141- description = lib.mdDoc "haskellPackages used to build gitit and plugins.";
4242- };
4343-4444- extraPackages = mkOption {
4545- type = types.functionTo (types.listOf types.package);
4646- default = self: [];
4747- example = literalExpression ''
4848- haskellPackages: [
4949- haskellPackages.wreq
5050- ]
5151- '';
5252- description = lib.mdDoc ''
5353- Extra packages available to ghc when running gitit. The
5454- value must be a function which receives the attrset defined
5555- in {var}`haskellPackages` as the sole argument.
5656- '';
5757- };
5858-5959- address = mkOption {
6060- type = types.str;
6161- default = "0.0.0.0";
6262- description = lib.mdDoc "IP address on which the web server will listen.";
6363- };
6464-6565- port = mkOption {
6666- type = types.int;
6767- default = 5001;
6868- description = lib.mdDoc "Port on which the web server will run.";
6969- };
7070-7171- wikiTitle = mkOption {
7272- type = types.str;
7373- default = "Gitit!";
7474- description = lib.mdDoc "The wiki title.";
7575- };
7676-7777- repositoryType = mkOption {
7878- type = types.enum ["git" "darcs" "mercurial"];
7979- default = "git";
8080- description = lib.mdDoc "Specifies the type of repository used for wiki content.";
8181- };
8282-8383- repositoryPath = mkOption {
8484- type = types.path;
8585- default = homeDir + "/wiki";
8686- description = lib.mdDoc ''
8787- Specifies the path of the repository directory. If it does not
8888- exist, gitit will create it on startup.
8989- '';
9090- };
9191-9292- requireAuthentication = mkOption {
9393- type = types.enum [ "none" "modify" "read" ];
9494- default = "modify";
9595- description = lib.mdDoc ''
9696- If 'none', login is never required, and pages can be edited
9797- anonymously. If 'modify', login is required to modify the wiki
9898- (edit, add, delete pages, upload files). If 'read', login is
9999- required to see any wiki pages.
100100- '';
101101- };
102102-103103- authenticationMethod = mkOption {
104104- type = types.enum [ "form" "http" "generic" "github" ];
105105- default = "form";
106106- description = lib.mdDoc ''
107107- 'form' means that users will be logged in and registered using forms
108108- in the gitit web interface. 'http' means that gitit will assume that
109109- HTTP authentication is in place and take the logged in username from
110110- the "Authorization" field of the HTTP request header (in addition,
111111- the login/logout and registration links will be suppressed).
112112- 'generic' means that gitit will assume that some form of
113113- authentication is in place that directly sets REMOTE_USER to the name
114114- of the authenticated user (e.g. mod_auth_cas on apache). 'rpx' means
115115- that gitit will attempt to log in through https://rpxnow.com. This
116116- requires that 'rpx-domain', 'rpx-key', and 'base-url' be set below,
117117- and that 'curl' be in the system path.
118118- '';
119119- };
120120-121121- userFile = mkOption {
122122- type = types.path;
123123- default = homeDir + "/gitit-users";
124124- description = lib.mdDoc ''
125125- Specifies the path of the file containing user login information. If
126126- it does not exist, gitit will create it (with an empty user list).
127127- This file is not used if 'http' is selected for
128128- authentication-method.
129129- '';
130130- };
131131-132132- sessionTimeout = mkOption {
133133- type = types.int;
134134- default = 60;
135135- description = lib.mdDoc ''
136136- Number of minutes of inactivity before a session expires.
137137- '';
138138- };
139139-140140- staticDir = mkOption {
141141- type = types.path;
142142- default = gititShared + "/data/static";
143143- description = lib.mdDoc ''
144144- Specifies the path of the static directory (containing javascript,
145145- css, and images). If it does not exist, gitit will create it and
146146- populate it with required scripts, stylesheets, and images.
147147- '';
148148- };
149149-150150- defaultPageType = mkOption {
151151- type = types.enum [ "markdown" "rst" "latex" "html" "markdown+lhs" "rst+lhs" "latex+lhs" ];
152152- default = "markdown";
153153- description = lib.mdDoc ''
154154- Specifies the type of markup used to interpret pages in the wiki.
155155- Possible values are markdown, rst, latex, html, markdown+lhs,
156156- rst+lhs, and latex+lhs. (the +lhs variants treat the input as
157157- literate Haskell. See pandoc's documentation for more details.) If
158158- Markdown is selected, pandoc's syntax extensions (for footnotes,
159159- delimited code blocks, etc.) will be enabled. Note that pandoc's
160160- restructuredtext parser is not complete, so some pages may not be
161161- rendered correctly if rst is selected. The same goes for latex and
162162- html.
163163- '';
164164- };
165165-166166- math = mkOption {
167167- type = types.enum [ "mathml" "raw" "mathjax" "jsmath" "google" ];
168168- default = "mathml";
169169- description = lib.mdDoc ''
170170- Specifies how LaTeX math is to be displayed. Possible values are
171171- mathml, raw, mathjax, jsmath, and google. If mathml is selected,
172172- gitit will convert LaTeX math to MathML and link in a script,
173173- MathMLinHTML.js, that allows the MathML to be seen in Gecko browsers,
174174- IE + mathplayer, and Opera. In other browsers you may get a jumble of
175175- characters. If raw is selected, the LaTeX math will be displayed as
176176- raw LaTeX math. If mathjax is selected, gitit will link to the
177177- remote mathjax script. If jsMath is selected, gitit will link to the
178178- script /js/jsMath/easy/load.js, and will assume that jsMath has been
179179- installed into the js/jsMath directory. This is the most portable
180180- solution. If google is selected, the google chart API is called to
181181- render the formula as an image. This requires a connection to google,
182182- and might raise a technical or a privacy problem.
183183- '';
184184- };
185185-186186- mathJaxScript = mkOption {
187187- type = types.str;
188188- default = "https://d3eoax9i5htok0.cloudfront.net/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
189189- description = lib.mdDoc ''
190190- Specifies the path to MathJax rendering script. You might want to
191191- use your own MathJax script to render formulas without Internet
192192- connection or if you want to use some special LaTeX packages. Note:
193193- path specified there cannot be an absolute path to a script on your
194194- hdd, instead you should run your (local if you wish) HTTP server
195195- which will serve the MathJax.js script. You can easily (in four lines
196196- of code) serve MathJax.js using
197197- http://happstack.com/docs/crashcourse/FileServing.html Do not forget
198198- the "http://" prefix (e.g. http://localhost:1234/MathJax.js).
199199- '';
200200- };
201201-202202- showLhsBirdTracks = mkOption {
203203- type = types.bool;
204204- default = false;
205205- description = lib.mdDoc ''
206206- Specifies whether to show Haskell code blocks in "bird style", with
207207- "> " at the beginning of each line.
208208- '';
209209- };
210210-211211- templatesDir = mkOption {
212212- type = types.path;
213213- default = gititShared + "/data/templates";
214214- description = lib.mdDoc ''
215215- Specifies the path of the directory containing page templates. If it
216216- does not exist, gitit will create it with default templates. Users
217217- may wish to edit the templates to customize the appearance of their
218218- wiki. The template files are HStringTemplate templates. Variables to
219219- be interpolated appear between $\'s. Literal $\'s must be
220220- backslash-escaped.
221221- '';
222222- };
223223-224224- logFile = mkOption {
225225- type = types.path;
226226- default = homeDir + "/gitit.log";
227227- description = lib.mdDoc ''
228228- Specifies the path of gitit's log file. If it does not exist, gitit
229229- will create it. The log is in Apache combined log format.
230230- '';
231231- };
232232-233233- logLevel = mkOption {
234234- type = types.enum [ "DEBUG" "INFO" "NOTICE" "WARNING" "ERROR" "CRITICAL" "ALERT" "EMERGENCY" ];
235235- default = "ERROR";
236236- description = lib.mdDoc ''
237237- Determines how much information is logged. Possible values (from
238238- most to least verbose) are DEBUG, INFO, NOTICE, WARNING, ERROR,
239239- CRITICAL, ALERT, EMERGENCY.
240240- '';
241241- };
242242-243243- frontPage = mkOption {
244244- type = types.str;
245245- default = "Front Page";
246246- description = lib.mdDoc ''
247247- Specifies which wiki page is to be used as the wiki's front page.
248248- Gitit creates a default front page on startup, if one does not exist
249249- already.
250250- '';
251251- };
252252-253253- noDelete = mkOption {
254254- type = types.str;
255255- default = "Front Page, Help";
256256- description = lib.mdDoc ''
257257- Specifies pages that cannot be deleted through the web interface.
258258- (They can still be deleted directly using git or darcs.) A
259259- comma-separated list of page names. Leave blank to allow every page
260260- to be deleted.
261261- '';
262262- };
263263-264264- noEdit = mkOption {
265265- type = types.str;
266266- default = "Help";
267267- description = lib.mdDoc ''
268268- Specifies pages that cannot be edited through the web interface.
269269- Leave blank to allow every page to be edited.
270270- '';
271271- };
272272-273273- defaultSummary = mkOption {
274274- type = types.str;
275275- default = "";
276276- description = lib.mdDoc ''
277277- Specifies text to be used in the change description if the author
278278- leaves the "description" field blank. If default-summary is blank
279279- (the default), the author will be required to fill in the description
280280- field.
281281- '';
282282- };
283283-284284- tableOfContents = mkOption {
285285- type = types.bool;
286286- default = true;
287287- description = lib.mdDoc ''
288288- Specifies whether to print a tables of contents (with links to
289289- sections) on each wiki page.
290290- '';
291291- };
292292-293293- plugins = mkOption {
294294- type = with types; listOf str;
295295- default = [ (gititShared + "/plugins/Dot.hs") ];
296296- description = lib.mdDoc ''
297297- Specifies a list of plugins to load. Plugins may be specified either
298298- by their path or by their module name. If the plugin name starts
299299- with Gitit.Plugin., gitit will assume that the plugin is an installed
300300- module and will not try to find a source file.
301301- '';
302302- };
303303-304304- useCache = mkOption {
305305- type = types.bool;
306306- default = false;
307307- description = lib.mdDoc ''
308308- Specifies whether to cache rendered pages. Note that if use-feed is
309309- selected, feeds will be cached regardless of the value of use-cache.
310310- '';
311311- };
312312-313313- cacheDir = mkOption {
314314- type = types.path;
315315- default = homeDir + "/cache";
316316- description = lib.mdDoc "Path where rendered pages will be cached.";
317317- };
318318-319319- maxUploadSize = mkOption {
320320- type = types.str;
321321- default = "1000K";
322322- description = lib.mdDoc ''
323323- Specifies an upper limit on the size (in bytes) of files uploaded
324324- through the wiki's web interface. To disable uploads, set this to
325325- 0K. This will result in the uploads link disappearing and the
326326- _upload url becoming inactive.
327327- '';
328328- };
329329-330330- maxPageSize = mkOption {
331331- type = types.str;
332332- default = "1000K";
333333- description = lib.mdDoc "Specifies an upper limit on the size (in bytes) of pages.";
334334- };
335335-336336- debugMode = mkOption {
337337- type = types.bool;
338338- default = false;
339339- description = lib.mdDoc "Causes debug information to be logged while gitit is running.";
340340- };
341341-342342- compressResponses = mkOption {
343343- type = types.bool;
344344- default = true;
345345- description = lib.mdDoc "Specifies whether HTTP responses should be compressed.";
346346- };
347347-348348- mimeTypesFile = mkOption {
349349- type = types.path;
350350- default = "/etc/mime/types.info";
351351- description = lib.mdDoc ''
352352- Specifies the path of a file containing mime type mappings. Each
353353- line of the file should contain two fields, separated by whitespace.
354354- The first field is the mime type, the second is a file extension.
355355- For example:
356356- ```
357357- video/x-ms-wmx wmx
358358- ```
359359- If the file is not found, some simple defaults will be used.
360360- '';
361361- };
362362-363363- useReCaptcha = mkOption {
364364- type = types.bool;
365365- default = false;
366366- description = lib.mdDoc ''
367367- If true, causes gitit to use the reCAPTCHA service
368368- (http://recaptcha.net) to prevent bots from creating accounts.
369369- '';
370370- };
371371-372372- reCaptchaPrivateKey = mkOption {
373373- type = with types; nullOr str;
374374- default = null;
375375- description = lib.mdDoc ''
376376- Specifies the private key for the reCAPTCHA service. To get
377377- these, you need to create an account at http://recaptcha.net.
378378- '';
379379- };
380380-381381- reCaptchaPublicKey = mkOption {
382382- type = with types; nullOr str;
383383- default = null;
384384- description = lib.mdDoc ''
385385- Specifies the public key for the reCAPTCHA service. To get
386386- these, you need to create an account at http://recaptcha.net.
387387- '';
388388- };
389389-390390- accessQuestion = mkOption {
391391- type = types.str;
392392- default = "What is the code given to you by Ms. X?";
393393- description = lib.mdDoc ''
394394- Specifies a question that users must answer when they attempt to
395395- create an account
396396- '';
397397- };
398398-399399- accessQuestionAnswers = mkOption {
400400- type = types.str;
401401- default = "RED DOG, red dog";
402402- description = lib.mdDoc ''
403403- Specifies a question that users must answer when they attempt to
404404- create an account, along with a comma-separated list of acceptable
405405- answers. This can be used to institute a rudimentary password for
406406- signing up as a user on the wiki, or as an alternative to reCAPTCHA.
407407- Example:
408408- access-question: What is the code given to you by Ms. X?
409409- access-question-answers: RED DOG, red dog
410410- '';
411411- };
412412-413413- rpxDomain = mkOption {
414414- type = with types; nullOr str;
415415- default = null;
416416- description = lib.mdDoc ''
417417- Specifies the domain and key of your RPX account. The domain is just
418418- the prefix of the complete RPX domain, so if your full domain is
419419- 'https://foo.rpxnow.com/', use 'foo' as the value of rpx-domain.
420420- '';
421421- };
422422-423423- rpxKey = mkOption {
424424- type = with types; nullOr str;
425425- default = null;
426426- description = lib.mdDoc "RPX account access key.";
427427- };
428428-429429- mailCommand = mkOption {
430430- type = types.str;
431431- default = "sendmail %s";
432432- description = lib.mdDoc ''
433433- Specifies the command to use to send notification emails. '%s' will
434434- be replaced by the destination email address. The body of the
435435- message will be read from stdin. If this field is left blank,
436436- password reset will not be offered.
437437- '';
438438- };
439439-440440- resetPasswordMessage = mkOption {
441441- type = types.lines;
442442- default = ''
443443- > From: gitit@$hostname$
444444- > To: $useremail$
445445- > Subject: Wiki password reset
446446- >
447447- > Hello $username$,
448448- >
449449- > To reset your password, please follow the link below:
450450- > http://$hostname$:$port$$resetlink$
451451- >
452452- > Regards
453453- '';
454454- description = lib.mdDoc ''
455455- Gives the text of the message that will be sent to the user should
456456- she want to reset her password, or change other registration info.
457457- The lines must be indented, and must begin with '>'. The initial
458458- spaces and '> ' will be stripped off. $username$ will be replaced by
459459- the user's username, $useremail$ by her email address, $hostname$ by
460460- the hostname on which the wiki is running (as returned by the
461461- hostname system call), $port$ by the port on which the wiki is
462462- running, and $resetlink$ by the relative path of a reset link derived
463463- from the user's existing hashed password. If your gitit wiki is being
464464- proxied to a location other than the root path of $port$, you should
465465- change the link to reflect this: for example, to
466466- http://$hostname$/path/to/wiki$resetlink$ or
467467- http://gitit.$hostname$$resetlink$
468468- '';
469469- };
470470-471471- useFeed = mkOption {
472472- type = types.bool;
473473- default = false;
474474- description = lib.mdDoc ''
475475- Specifies whether an ATOM feed should be enabled (for the site and
476476- for individual pages).
477477- '';
478478- };
479479-480480- baseUrl = mkOption {
481481- type = with types; nullOr str;
482482- default = null;
483483- description = lib.mdDoc ''
484484- The base URL of the wiki, to be used in constructing feed IDs and RPX
485485- token_urls. Set this if useFeed is false or authentication-method
486486- is 'rpx'.
487487- '';
488488- };
489489-490490- absoluteUrls = mkOption {
491491- type = types.bool;
492492- default = false;
493493- description = lib.mdDoc ''
494494- Make wikilinks absolute with respect to the base-url. So, for
495495- example, in a wiki served at the base URL '/wiki', on a page
496496- Sub/Page, the wikilink `[Cactus]()` will produce a link to
497497- '/wiki/Cactus' if absoluteUrls is true, and a relative link to
498498- 'Cactus' (referring to '/wiki/Sub/Cactus') if absolute-urls is 'no'.
499499- '';
500500- };
501501-502502- feedDays = mkOption {
503503- type = types.int;
504504- default = 14;
505505- description = lib.mdDoc "Number of days to be included in feeds.";
506506- };
507507-508508- feedRefreshTime = mkOption {
509509- type = types.int;
510510- default = 60;
511511- description = lib.mdDoc "Number of minutes to cache feeds before refreshing.";
512512- };
513513-514514- pdfExport = mkOption {
515515- type = types.bool;
516516- default = false;
517517- description = lib.mdDoc ''
518518- If true, PDF will appear in export options. PDF will be created using
519519- pdflatex, which must be installed and in the path. Note that PDF
520520- exports create significant additional server load.
521521- '';
522522- };
523523-524524- pandocUserData = mkOption {
525525- type = with types; nullOr path;
526526- default = null;
527527- description = lib.mdDoc ''
528528- If a directory is specified, this will be searched for pandoc
529529- customizations. These can include a templates/ directory for custom
530530- templates for various export formats, an S5 directory for custom S5
531531- styles, and a reference.odt for ODT exports. If no directory is
532532- specified, $HOME/.pandoc will be searched. See pandoc's README for
533533- more information.
534534- '';
535535- };
536536-537537- xssSanitize = mkOption {
538538- type = types.bool;
539539- default = true;
540540- description = lib.mdDoc ''
541541- If true, all HTML (including that produced by pandoc) is filtered
542542- through xss-sanitize. Set to no only if you trust all of your users.
543543- '';
544544- };
545545-546546- oauthClientId = mkOption {
547547- type = with types; nullOr str;
548548- default = null;
549549- description = lib.mdDoc "OAuth client ID";
550550- };
551551-552552- oauthClientSecret = mkOption {
553553- type = with types; nullOr str;
554554- default = null;
555555- description = lib.mdDoc "OAuth client secret";
556556- };
557557-558558- oauthCallback = mkOption {
559559- type = with types; nullOr str;
560560- default = null;
561561- description = lib.mdDoc "OAuth callback URL";
562562- };
563563-564564- oauthAuthorizeEndpoint = mkOption {
565565- type = with types; nullOr str;
566566- default = null;
567567- description = lib.mdDoc "OAuth authorize endpoint";
568568- };
569569-570570- oauthAccessTokenEndpoint = mkOption {
571571- type = with types; nullOr str;
572572- default = null;
573573- description = lib.mdDoc "OAuth access token endpoint";
574574- };
575575-576576- githubOrg = mkOption {
577577- type = with types; nullOr str;
578578- default = null;
579579- description = lib.mdDoc "Github organization";
580580- };
581581- };
582582-583583- configFile = pkgs.writeText "gitit.conf" ''
584584- address: ${cfg.address}
585585- port: ${toString cfg.port}
586586- wiki-title: ${cfg.wikiTitle}
587587- repository-type: ${cfg.repositoryType}
588588- repository-path: ${cfg.repositoryPath}
589589- require-authentication: ${cfg.requireAuthentication}
590590- authentication-method: ${cfg.authenticationMethod}
591591- user-file: ${cfg.userFile}
592592- session-timeout: ${toString cfg.sessionTimeout}
593593- static-dir: ${cfg.staticDir}
594594- default-page-type: ${cfg.defaultPageType}
595595- math: ${cfg.math}
596596- mathjax-script: ${cfg.mathJaxScript}
597597- show-lhs-bird-tracks: ${toYesNo cfg.showLhsBirdTracks}
598598- templates-dir: ${cfg.templatesDir}
599599- log-file: ${cfg.logFile}
600600- log-level: ${cfg.logLevel}
601601- front-page: ${cfg.frontPage}
602602- no-delete: ${cfg.noDelete}
603603- no-edit: ${cfg.noEdit}
604604- default-summary: ${cfg.defaultSummary}
605605- table-of-contents: ${toYesNo cfg.tableOfContents}
606606- plugins: ${concatStringsSep "," cfg.plugins}
607607- use-cache: ${toYesNo cfg.useCache}
608608- cache-dir: ${cfg.cacheDir}
609609- max-upload-size: ${cfg.maxUploadSize}
610610- max-page-size: ${cfg.maxPageSize}
611611- debug-mode: ${toYesNo cfg.debugMode}
612612- compress-responses: ${toYesNo cfg.compressResponses}
613613- mime-types-file: ${cfg.mimeTypesFile}
614614- use-recaptcha: ${toYesNo cfg.useReCaptcha}
615615- recaptcha-private-key: ${toString cfg.reCaptchaPrivateKey}
616616- recaptcha-public-key: ${toString cfg.reCaptchaPublicKey}
617617- access-question: ${cfg.accessQuestion}
618618- access-question-answers: ${cfg.accessQuestionAnswers}
619619- rpx-domain: ${toString cfg.rpxDomain}
620620- rpx-key: ${toString cfg.rpxKey}
621621- mail-command: ${cfg.mailCommand}
622622- reset-password-message: ${cfg.resetPasswordMessage}
623623- use-feed: ${toYesNo cfg.useFeed}
624624- base-url: ${toString cfg.baseUrl}
625625- absolute-urls: ${toYesNo cfg.absoluteUrls}
626626- feed-days: ${toString cfg.feedDays}
627627- feed-refresh-time: ${toString cfg.feedRefreshTime}
628628- pdf-export: ${toYesNo cfg.pdfExport}
629629- pandoc-user-data: ${toString cfg.pandocUserData}
630630- xss-sanitize: ${toYesNo cfg.xssSanitize}
631631-632632- [Github]
633633- oauthclientid: ${toString cfg.oauthClientId}
634634- oauthclientsecret: ${toString cfg.oauthClientSecret}
635635- oauthcallback: ${toString cfg.oauthCallback}
636636- oauthauthorizeendpoint: ${toString cfg.oauthAuthorizeEndpoint}
637637- oauthaccesstokenendpoint: ${toString cfg.oauthAccessTokenEndpoint}
638638- github-org: ${toString cfg.githubOrg}
639639- '';
640640-641641-in
642642-643643-{
644644-645645- options.services.gitit = gititOptions;
646646-647647- config = mkIf cfg.enable {
648648-649649- users.users.gitit = {
650650- group = config.users.groups.gitit.name;
651651- description = "Gitit user";
652652- home = homeDir;
653653- createHome = true;
654654- uid = config.ids.uids.gitit;
655655- };
656656-657657- users.groups.gitit.gid = config.ids.gids.gitit;
658658-659659- systemd.services.gitit = let
660660- uid = toString config.ids.uids.gitit;
661661- gid = toString config.ids.gids.gitit;
662662- in {
663663- description = "Git and Pandoc Powered Wiki";
664664- after = [ "network.target" ];
665665- wantedBy = [ "multi-user.target" ];
666666- path = with pkgs; [ curl ]
667667- ++ optional cfg.pdfExport texlive.combined.scheme-basic
668668- ++ optional (cfg.repositoryType == "darcs") darcs
669669- ++ optional (cfg.repositoryType == "mercurial") mercurial
670670- ++ optional (cfg.repositoryType == "git") git;
671671-672672- preStart = let
673673- gm = "gitit@${config.networking.hostName}";
674674- in
675675- with cfg; ''
676676- chown ${uid}:${gid} -R ${homeDir}
677677- for dir in ${repositoryPath} ${staticDir} ${templatesDir} ${cacheDir}
678678- do
679679- if [ ! -d $dir ]
680680- then
681681- mkdir -p $dir
682682- find $dir -type d -exec chmod 0750 {} +
683683- find $dir -type f -exec chmod 0640 {} +
684684- fi
685685- done
686686- cd ${repositoryPath}
687687- ${
688688- if repositoryType == "darcs" then
689689- ''
690690- if [ ! -d _darcs ]
691691- then
692692- darcs initialize
693693- echo "${gm}" > _darcs/prefs/email
694694- ''
695695- else if repositoryType == "mercurial" then
696696- ''
697697- if [ ! -d .hg ]
698698- then
699699- hg init
700700- cat >> .hg/hgrc <<NAMED
701701-[ui]
702702-username = gitit ${gm}
703703-NAMED
704704- ''
705705- else
706706- ''
707707- if [ ! -d .git ]
708708- then
709709- git init
710710- git config user.email "${gm}"
711711- git config user.name "gitit"
712712- ''}
713713- chown ${uid}:${gid} -R ${repositoryPath}
714714- fi
715715- cd -
716716- '';
717717-718718- serviceConfig = {
719719- User = config.users.users.gitit.name;
720720- Group = config.users.groups.gitit.name;
721721- ExecStart = with cfg; gititSh haskellPackages extraPackages;
722722- };
723723- };
724724- };
725725-}
···5555 # set the env "LOCAL_GIT_DIRECTORY" for dugite so that we can use the git in nixpkgs
5656 makeWrapper ${electron}/bin/electron $out/bin/${pname} \
5757 --set "LOCAL_GIT_DIRECTORY" ${git} \
5858- --add-flags $out/share/${pname}/resources/app
5858+ --add-flags $out/share/${pname}/resources/app \
5959+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
5960 '';
60616162 passthru.updateScript = nix-update-script { };
···7788 # Please keep the version x.y.0.z and do not update to x.y.76.z because the
99 # source of the latter disappears much faster.
1010- version = "8.87.0.406";
1010+ version = "8.96.0.207";
11111212 rpath = lib.makeLibraryPath [
1313 alsa-lib
···6868 "https://mirror.cs.uchicago.edu/skype/pool/main/s/skypeforlinux/skypeforlinux_${version}_amd64.deb"
6969 "https://web.archive.org/web/https://repo.skype.com/deb/pool/main/s/skypeforlinux/skypeforlinux_${version}_amd64.deb"
7070 ];
7171- sha256 = "sha256-lWnQIdMmfz90h3tOWkQv0vo3HnRi3z6W27vK28+Ksjo=";
7171+ sha256 = "sha256-tkOPYFkmc4nzO8Rgat9/VNuzzIW10qSEzbXhjkZV83k=";
7272 }
7373 else
7474 throw "Skype for linux is not supported on ${stdenv.hostPlatform.system}";
···546546# Locked as long as quoted-printable encoding issues are not resolved
547547# Monkey-patched in `config/initializers/mail_encoding_patch.rb`
548548# See https://gitlab.com/gitlab-org/gitlab/issues/197386
549549-gem 'mail', '= 2.7.1'
549549+gem 'mail', '= 2.8.1'
550550gem 'mail-smtp_pool', '~> 0.1.0', path: 'vendor/gems/mail-smtp_pool', require: false
551551552552gem 'microsoft_graph_mailer', '~> 0.1.0', path: 'vendor/gems/microsoft_graph_mailer'
···593593# For phone verification
594594gem 'telesignenterprise', '~> 2.2'
595595596596-# Ruby 3 extracts net-protocol into a separate gem, while Ruby 2 has it built-in
597597-# This condition installs the gem only for Ruby 3 to avoid warnings on Ruby 2
598598-# Can be removed when support for Ruby 2 is dropped
599599-install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0") } do
600600- # BufferedIO patch
601601- gem 'net-protocol', '~> 0.1.3'
602602-end
596596+# BufferedIO patch
597597+# Updating this version will require updating scripts/allowed_warnings.txt
598598+gem 'net-protocol', '~> 0.1.3'
603599604600gem 'duo_api', '~> 1.3'
···11{ lib
22-, python3Packages
22+, python3
33}:
4455-python3Packages.buildPythonApplication rec {
55+python3.pkgs.buildPythonApplication rec {
66 pname = "tockloader";
77- version = "1.6.0";
77+ version = "1.9.0";
8899- src = python3Packages.fetchPypi {
99+ src = python3.pkgs.fetchPypi {
1010 inherit pname version;
1111- sha256 = "1aqkj1nplcw3gmklrhq6vxy6v9ad5mqiw4y1svasak2zkqdk1wyc";
1111+ hash = "sha256-7W55jugVtamFUL8N3dD1LFLJP2UDQb74V6o96rd/tEg=";
1212 };
13131414- propagatedBuildInputs = with python3Packages; [
1414+ propagatedBuildInputs = with python3.pkgs; [
1515 argcomplete
1616 colorama
1717 crcmod
1818+ pycryptodome
1819 pyserial
1919- pytoml
2020+ questionary
2121+ toml
2022 tqdm
2123 ];
22242323- # has no test suite
2525+ # Project has no test suite
2426 checkPhase = ''
2527 runHook preCheck
2628 $out/bin/tockloader --version | grep -q ${version}
···2830 '';
29313032 meta = with lib; {
3333+ description = "Tool for programming Tock onto hardware boards";
3134 homepage = "https://github.com/tock/tockloader";
3535+ changelog = "https://github.com/tock/tockloader/releases/tag/v${version}";
3236 license = licenses.mit;
3333- description = "Tool for programming Tock onto hardware boards";
3437 maintainers = with maintainers; [ ];
3538 };
3639}
+5-10
pkgs/games/anki/bin.nix
···5151 passthru = { inherit sources; };
52525353 fhsUserEnvAnki = buildFHSUserEnv (appimageTools.defaultFhsEnvArgs // {
5454- name = "anki";
5454+ inherit pname version;
5555+ name = null; # Appimage sets it to "appimage-env"
55565657 # Dependencies of anki
5758 targetPkgs = pkgs: (with pkgs; [ xorg.libxkbfile krb5 ]);
···6162 '';
62636364 extraInstallCommands = ''
6565+ ln -s ${pname} $out/bin/anki
6666+6467 mkdir -p $out/share
6568 cp -R ${unpacked}/share/applications \
6669 ${unpacked}/share/man \
···70737174 inherit meta passthru;
7275 });
7373-7474- fhsUserEnvAnkiWithVersion = fhsUserEnvAnki.overrideAttrs (oldAttrs: {
7575- # buildFHSUserEnv doesn't have an easy way to set the version of the
7676- # resulting derivation, so we manually override it here. This makes
7777- # it clear to end users the version of anki-bin. Without this, users
7878- # might assume anki-bin is an old version of Anki.
7979- name = "${pname}-${version}";
8080- });
8176in
82778383-if stdenv.isLinux then fhsUserEnvAnkiWithVersion
7878+if stdenv.isLinux then fhsUserEnvAnki
8479else stdenv.mkDerivation {
8580 inherit pname version passthru;
8681