1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-05 16:41:04 +01:00
home-manager/modules/programs/darcs.nix
Austin Horstman 0b491b460f
treewide: remove with lib (#6735)
Continuation of `with lib;` cleanup.
2025-03-31 22:32:16 -05:00

46 lines
1.3 KiB
Nix

{ config, lib, pkgs, ... }:
let cfg = config.programs.darcs;
in {
meta.maintainers = with lib.maintainers; [ chris-martin ];
options = {
programs.darcs = {
enable = lib.mkEnableOption "darcs";
package = lib.mkPackageOption pkgs "darcs" { nullable = true; };
author = lib.mkOption {
type = lib.types.listOf lib.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 = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "^.idea$" ".iml$" "^.stack-work$" ];
description = "File patterns to ignore";
};
};
};
config = lib.mkIf cfg.enable (lib.mkMerge [
{ home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; }
(lib.mkIf (cfg.author != [ ]) {
home.file.".darcs/author".text =
lib.concatMapStrings (x: x + "\n") cfg.author;
})
(lib.mkIf (cfg.boring != [ ]) {
home.file.".darcs/boring".text =
lib.concatMapStrings (x: x + "\n") cfg.boring;
})
]);
}