Merge pull request #141255 from mkg20001/lfs

This commit is contained in:
Maciej Krüger 2021-10-11 18:52:03 +02:00 committed by GitHub
commit e4ef597edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,15 +31,39 @@ in
section of git-config(1) for more information.
'';
};
lfs = {
enable = mkEnableOption "git-lfs";
package = mkOption {
type = types.package;
default = pkgs.git-lfs;
defaultText = literalExpression "pkgs.git-lfs";
description = "The git-lfs package to use";
};
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
environment.etc.gitconfig = mkIf (cfg.config != {}) {
text = generators.toGitINI cfg.config;
};
};
config = mkMerge [
(mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
environment.etc.gitconfig = mkIf (cfg.config != {}) {
text = generators.toGitINI cfg.config;
};
})
(mkIf (cfg.enable && cfg.lfs.enable) {
environment.systemPackages = [ cfg.lfs.package ];
programs.git.config = {
filter.lfs = {
clean = "git-lfs clean -- %f";
smudge = "git-lfs smudge -- %f";
process = "git-lfs filter-process";
required = true;
};
};
})
];
meta.maintainers = with maintainers; [ figsoda ];
}