NixOS system configurations + dotfiles via home-manager
1{ lib, ... }:
2let
3 settings = {
4 user.name = "Peter Rice";
5 user.email = lib.mkDefault "peterrice@fastmail.com";
6 init.defaultBranch = "main";
7 commit.verbose = true;
8 interactive.singleKey = true;
9 diff.algorithm = "patience";
10 merge.conflictstyle = "zdiff3";
11 pull.rebase = true;
12 push.default = "current";
13 rebase.autostash = true;
14 rebase.autosquash = true;
15 rebase.updateRefs = true;
16 branch.autoSetupRebase = "always";
17 branch.sort = "-committerdate";
18 url."git@github.com:".insteadOf = "github:";
19 };
20in
21{
22 flake.modules.hjem.core =
23 { pkgs, ... }:
24 {
25 packages = [
26 pkgs.git
27 pkgs.fishPlugins.plugin-git
28 ];
29
30 xdg.config.files = {
31 "git/config" = {
32 generator = lib.generators.toGitINI;
33 value = settings;
34 };
35 "git/ignore".text = ''
36 .envrc
37 .direnv
38 .ignore
39 result*
40 *.qcow2
41 *.fd
42 .nixos-test-history
43 '';
44 };
45
46 fish.interactiveShellInit = ''
47 __git.init
48 abbr gcp 'git commit -p'
49 abbr gcp! 'git commit -p --amend'
50 abbr gcpn! 'git commit -p --no-edit --amend'
51 '';
52 };
53}