Skip to content

Build fails due to .gitignore pattern excluding direnv.nix #11

@popey

Description

@popey

Description

The build process fails with a "path does not exist" error for because the pattern incorrectly excludes this required file from version control.

Steps to Reproduce

  1. Clone the noughtylinux/config repository
  2. Set up the required configuration files (config.toml with system/user sections)
  3. Run just build

Expected Behavior

The build should complete successfully, building both system-manager and home-manager configurations.

Actual Behavior

The build fails with:

error: path '/nix/store/...-source/home-manager/terminal/direnv.nix' does not exist

This occurs because:

  • The file exists in the working directory
  • home-manager/terminal/default.nix imports ./direnv.nix
  • The .gitignore pattern .direnv* prevents Git from tracking the file
  • Nix flakes only include Git-tracked files in the store

Error Messages

error:
       … while evaluating a branch condition
         at /nix/store/.../lib/lists.nix:142:18:
          141|       len = length list;
          142|       fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));

       error: path '/nix/store/.../home-manager/terminal/direnv.nix' does not exist

Workaround

Run git add -f home-manager/terminal/direnv.nix to force-add the file despite the gitignore pattern.

Proposed Fix

Update .gitignore to be more specific, e.g.:

.direnv/
.envrc

Instead of the overly broad:

.direnv*

This would exclude direnv's working directory and environment files while preserving the required direnv.nix configuration file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions