home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

git.nix (583B)


      1 { config, lib, pkgs, ... }:
      2 let
      3   inherit (lib) mkEnableOption mkIf;
      4   cfg = config.modules.shell.git;
      5 in
      6 {
      7   options.modules.shell.git = {
      8     enable = mkEnableOption "enable git";
      9   };
     10   config = mkIf cfg.enable {
     11     environment = {
     12       # Install some packages
     13       systemPackages = with pkgs; [
     14         git
     15         # gitAndTools.git-extras
     16         (mkIf config.modules.shell.gnupg.enable
     17           gitAndTools.git-crypt)
     18         lazygit
     19       ];
     20       # Default gitconfig
     21       etc."gitconfig".source = ./git/config;
     22       etc."gitignore".source = ./git/ignore;
     23     };
     24   };
     25 }