home: git: add default ignores

This commit is contained in:
Bruno BELANYI 2021-02-19 22:16:22 +00:00
parent d5ec493b92
commit bf2671a162
2 changed files with 35 additions and 1 deletions

26
home/git/default.ignore Normal file
View file

@ -0,0 +1,26 @@
# C/C++ binary files
*.so
*.o
*.a
*.out
# Python files
env/
__pycache__/
*.py[cod]
.mypy_cache/
.dmypy.json
dmypy.json
# Build system files
compile_commands.json
# Debugger files
.gdb_history
# LSP cache
.clangd/
# Swap and backup files
*~
~.swp

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
programs.git = {
enable = true;
@ -96,5 +96,13 @@
includes = [
{ path = ./epita.config; condition = "gitdir:~/git/EPITA/"; }
];
ignores =
let
readLines = file: lib.splitString "\n" (builtins.readFile file);
removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
getPaths = file: removeComments (readLines file);
in
getPaths ./default.ignore;
};
}