mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-19 06:43:01 +00:00
Can generate the config without installing application through home-manager. Helpful when a package is broken (or not provided) on a specific platform through nixpkgs and needs to be installed through other means but you still can benefit from the declarative configuration.
52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
{ 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" { nullable = true; };
|
|
|
|
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 = lib.mkIf (cfg.package != null) [ 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;
|
|
})
|
|
|
|
]);
|
|
}
|