git: add attributes support

This commit is contained in:
Mario Rodas 2019-09-24 04:20:00 -05:00 committed by Matthieu Coudron
parent 3f45630180
commit bb5c29107e

View file

@ -179,6 +179,13 @@ in
description = "List of paths that should be globally ignored."; description = "List of paths that should be globally ignored.";
}; };
attributes = mkOption {
type = types.listOf types.str;
default = [];
example = [ "*.pdf diff=pdf" ];
description = "List of defining attributes set globally.";
};
includes = mkOption { includes = mkOption {
type = types.listOf includeModule; type = types.listOf includeModule;
default = []; default = [];
@ -226,6 +233,10 @@ in
"git/ignore" = mkIf (cfg.ignores != []) { "git/ignore" = mkIf (cfg.ignores != []) {
text = concatStringsSep "\n" cfg.ignores + "\n"; text = concatStringsSep "\n" cfg.ignores + "\n";
}; };
"git/attributes" = mkIf (cfg.attributes != []) {
text = concatStringsSep "\n" cfg.attributes + "\n";
};
}; };
} }