fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Chris Martindarcs: add module050d01a6

master
1.2 KiB52 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7  cfg = config.programs.darcs;
8
9in {
10  meta.maintainers = with maintainers; [ chris-martin ];
11
12  options = {
13    programs.darcs = {
14      enable = mkEnableOption "darcs";
15
16      package = mkPackageOption pkgs "darcs" { };
17
18      author = mkOption {
19        type = types.listOf types.str;
20        default = [ ];
21        example = [ "Fred Bloggs <fred@example.net>" ];
22        description = ''
23          If this list has a single entry, it will be used as the author
24          when you record a patch. If there are multiple entries, Darcs
25          will prompt you to choose one of them.
26        '';
27      };
28
29      boring = mkOption {
30        type = types.listOf types.str;
31        default = [ ];
32        example = [ "^.idea$" ".iml$" "^.stack-work$" ];
33        description = "File patterns to ignore";
34      };
35    };
36  };
37
38  config = mkIf cfg.enable (mkMerge [
39    { home.packages = [ cfg.package ]; }
40
41    (mkIf (cfg.author != [ ]) {
42      home.file.".darcs/author".text =
43        concatMapStrings (x: x + "\n") cfg.author;
44    })
45
46    (mkIf (cfg.boring != [ ]) {
47      home.file.".darcs/boring".text =
48        concatMapStrings (x: x + "\n") cfg.boring;
49    })
50
51  ]);
52}