summaryrefslogtreecommitdiff
path: root/modules/devenv/integrations/gitignore.nix
blob: ed0e61afa6692be117c90aa22b41d25ee93d79e3 (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
{
  config,
  lib,
  ...
}: let
  cfg = config.gitignore;
in {
  options.gitignore = {
    extra = lib.mkOption {
      type = lib.types.lines;
      default = "";
      example = ''
        *.my-file-extension
      '';
    };
  };

  config.dotfiles.gitignore = lib.mkIf (cfg.extra != "") {
    gitignore = lib.mkDefault false;
    text = ''
      ## Miscellaneous
      ${cfg.extra};
    '';
  };
}