1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/yarn/default.nix
Friedrich Altheide a1817d1c0e yarn: improve docs
2025-07-25 14:03:11 -05:00

53 lines
1,012 B
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkOption
;
cfg = config.programs.yarn;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = [ lib.maintainers.friedrichaltheide ];
options.programs.yarn = {
enable = mkEnableOption "management of yarn config";
settings = mkOption {
type = yamlFormat.type;
default = { };
example = lib.literalExpression ''
{
httpProxy = "http://proxy.example.org:3128";
httpsProxy = "http://proxy.example.org:3128";
}
'';
description = ''
Available configuration options for yarn see:
<https://yarnpkg.com/configuration/yarnrc>
'';
};
};
config = mkIf cfg.enable {
home = {
file =
let
yarnRcFileName = ".yarnrc.yml";
in
{
"${yarnRcFileName}" = {
source = yamlFormat.generate "${yarnRcFileName}" cfg.settings;
};
};
};
};
}