fork/home-manager
git clone https://git.julia.blue/fork/home-manager
5bb1f675
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7gitInclude = { 8user = { 9name = "John Doe" ; 10= "user@example.org" ; 11}; 12}; 13 14substituteExpected = path : 15pkgs . substituteAll { 16src = path ; 17git_include_path = pkgs . writeText "hm_gitconfig" 18( builtins . readFile ./git-expected-include.conf ); 19git_named_include_path = pkgs . writeText "hm_gitconfigwork" 20( builtins . readFile ./git-expected-include.conf ); 21}; 22 23in { 24config = { 25programs . git = mkMerge [ 26{ 27enable = true ; 28package = pkgs . gitMinimal ; 29aliases = { 30a1 = "foo" ; 31a2 = "bar" ; 32escapes = ''"\n '' ; 33}; 34extraConfig = { 35extra = { 36name = "value" ; 37multiple = [ 1 ]; 38}; 39}; 40ignores = [ "*~" "*.swp" ]; 41includes = [ 42{ path = "~/path/to/config.inc" ; } 43{ 44path = "~/path/to/conditional.inc" ; 45condition = "gitdir:~/src/dir" ; 46} 47{ 48condition = "gitdir:~/src/dir" ; 49contents = gitInclude ; 50} 51{ 52condition = "gitdir:~/src/otherproject" ; 53contents = gitInclude ; 54contentSuffix = "gitconfig-work" ; 55} 56]; 57signing = { 58gpgPath = "path-to-gpg" ; 59key = "00112233445566778899AABBCCDDEEFF" ; 60signByDefault = true ; 61}; 62userEmail = "user@example.org" ; 63userName = "John Doe" ; 64lfs . enable = true ; 65delta = { 66enable = true ; 67options = { 68features = "decorations" ; 69whitespace-error-style = "22 reverse" ; 70decorations = { 71commit-decoration-style = "bold yellow box ul" ; 72file-style = "bold yellow ul" ; 73file-decoration-style = "none" ; 74}; 75}; 76}; 77} 78 79{ 80aliases . a2 = mkForce "baz" ; 81extraConfig . "extra \"backcompat.with.dots\"" . previously = "worked" ; 82extraConfig . extra . boolean = true ; 83extraConfig . extra . integer = 38 ; 84extraConfig . extra . multiple = [ 2 ]; 85extraConfig . extra . subsection . value = "test" ; 86} 87]; 88 89test . stubs = { 90git-lfs = { }; 91delta = { }; 92}; 93 94nmt . script = '' 95assertFileExists home-files/.config/git/config 96assertFileContent home-files/.config/git/config ${ 97substituteExpected ./git-expected.conf 98} 99'' ; 100}; 101}