about summary refs log tree commit diff
path: root/home/profiles/development/default.nix
blob: 4bc761c880c4dc88f76593e41dbc8172b30f87e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{ config, lib, pkgs, self, ... }:

let
  cfg = config.profiles.development;
in
{
  options.profiles.development = {
    enable = lib.mkEnableOption
      "A profile that enables the system to be used for developing programs";
  };

  config = lib.mkIf cfg.enable {
    programs.git = {
      enable = true;
      package = pkgs.gitFull;

      userName = "zachel";
      userEmail = "zach@zachel.io";

      signing = {
        key = "346833414516C852FFB238E19F734565641C2F14";
        signByDefault = true;
      };

      aliases = {
        graph =
          "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold yellow)%h%C(reset) - %C(green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(normal)%s%C(reset) %C(blue)- %an%C(reset)' --all";
        co = "checkout";
        br = "branch";
        st = "status";
        ps = "push";
        pl = "pull";
        root = "rev-parse --show-toplevel";
      };

      extraConfig = {
        init.defaultBranch = "main";
        pull.rebase = true;

        merge.conflictStyle = "diff3";

        mergetool.fugitive = {
          cmd = ''nvim -f -c "Gvdiffsplit!" "$MERGED"'';
          trustExitCode = true;
        };

        merge.tool = "fugitive";
        mergetool.prompt = false;
      };

      ignores = [
        # IntelliJ files and folders
        ".idea/"
        "*.iml"
        # backupfiles and shadow copies done by editors
        "*~"
        "\\#*\\#"
        ".#*"
        # Elixir language server
        "/.elixir_ls"
        # MyPy Cache
        ".mypy_cache"
        # Visual Studio Code project configuration
        "/.vscode"
        # Result folder for nix builds
        "result"
        "result-*"
        # direnv caches
        ".direnv/"
        # emacs/python stuff
        "flycheck_*.py"
      ];
    };

    programs.vscode = {
      enable = if pkgs.stdenv.isDarwin then true else false;
      extensions = with pkgs.vscode-extensions; [
      ];
    };

    home.packages = [
      pkgs.bfg-repo-cleaner
      pkgs.diffoscopeMinimal
      pkgs.du-dust
      # pkgs.dnsutils # Err on darwin
      # TODO: https://github.com/cli/cli/issues/4955
      pkgs.gh
      pkgs.hyperfine
      pkgs.jq
      pkgs.lsof
      pkgs.ouch
      pkgs.tcpdump
      pkgs.tokei
      pkgs.mtr
      pkgs.nixpkgs-fmt
      pkgs.nixpkgs-review
      pkgs.nmap
      pkgs.ripgrep
      pkgs.rust-analyzer
      pkgs.sd
      pkgs.tig
      pkgs.xh
      pkgs.cargo-play
      pkgs.cargo-edit
      pkgs.cargo-sort
      pkgs.cargo-diet
      pkgs.cargo-deny
      pkgs.clang-tools
      pkgs.lldb
      pkgs.ghc
      pkgs.stack
      (pkgs.haskell-language-server.override { supportedGhcVersions = [ (builtins.replaceStrings [ "." ] [ "" ] pkgs.ghc.version) ]; })
    ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) [
      # TODO: currently broken/doesn't support Darwin
      pkgs.valgrind
    ];

    nixpkgs.allowedUnfree = [ "vscode" ];
  };
}