Skip to content

no-absolute-path-literals experimental feature #8738

@roberth

Description

@roberth

Is your feature request related to a problem? Please describe.

Path values are unfit for use as a "path string" replacement because for example

''
  HomeDirs: ${/home}
''

tries to add /home to the store.

In my experience, the only appropriate use is for referencing source files and locations within a repository. These path values are all created with relative path literals.

Describe the solution you'd like

Add an experimental feature flag or setting that disables absolute path literals such as /. and /home or /var/lib/foo.

Describe alternatives you've considered

  • Status quo. Keep telling users not to write absolute path literals
  • Deprecate them even more. Users would have to opt out of this flag to use /..

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposalidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.languageThe Nix expression language; parser, interpreter, primops, evaluation, etc

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions