MatrixAI / nixpkgs-matrix

A public nixpkgs/flakes overlay for Matrix AI projects.
https://matrix.ai
Apache License 2.0
1 stars 0 forks source link

Integrate new .gitignore system #3

Open brynblack opened 4 months ago

brynblack commented 4 months ago

Specification

There exists a more advanced .gitignore system called hercules-ci. Our current nix-gitignore.gitignoreSource still keeps .git in the produced output.

nix-gitignore.gitignoreSource [] ./.

Still has .git.

But you need to do:

nix-gitignore.gitignoreSource [".git"] ./.

Actually ignores it.

Now I didn't see this before, not sure if this is a regression.

However the hercules-ci gitignore is apparently the more advanced one.

Basically get this done: https://github.com/hercules-ci/gitignore.nix/issues/6

Tasks

  1. ...
  2. ...
  3. ...
aryanjassal commented 1 month ago

According to NixOS Wiki, for flakes in git repos, only files in the working tree will be copied to the store. Given that we are migrating our repos from using shell.nix to use flake.nix, this issue might be redundant.

CMCDragonkai commented 1 month ago

No, we still need to ignore more files then what is left in the working tree.

So it may be that we don't have to ignore .git, but we still have to ignore all other files. For example:

  src = nix-gitignore.gitignoreSource [
    # The `.git` itself should be ignored
    ".git"
    # Non-build files
    "/nodemon.json"
    # Hidden files
    "/.*"
    # Nix files
    "/*.nix"
    # Benchmarks
    "/benches"
    # Docs
    "/docs"
    # Tests
    "/tests"
    "/jest.config.js"
  ] ./.;

So this issue isn't redundant.