1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 15:19:45 +01:00
home-manager/modules/programs/darcs.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

2023-03-27 20:25:17 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.darcs;
in {
meta.maintainers = with maintainers; [ chris-martin ];
options = {
programs.darcs = {
enable = mkEnableOption "darcs";
package = mkPackageOption pkgs "darcs" { };
author = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "Fred Bloggs <fred@example.net>" ];
description = ''
If this list has a single entry, it will be used as the author
when you record a patch. If there are multiple entries, Darcs
will prompt you to choose one of them.
'';
};
boring = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "^.idea$" ".iml$" "^.stack-work$" ];
description = "File patterns to ignore";
};
};
};
config = mkIf cfg.enable (mkMerge [
{ home.packages = [ cfg.package ]; }
(mkIf (cfg.author != [ ]) {
home.file.".darcs/author".text =
concatMapStrings (x: x + "\n") cfg.author;
})
(mkIf (cfg.boring != [ ]) {
home.file.".darcs/boring".text =
concatMapStrings (x: x + "\n") cfg.boring;
})
]);
}