Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Shorten the paths, rename to package.nix #8

Merged
merged 7 commits into from
Nov 14, 2022
Merged

Conversation

roberth
Copy link
Contributor

@roberth roberth commented Oct 14, 2022

The shorter layout is slightly easier to use.
By using package.nix we clarify the purpose and format of the expression file, and open up to the possibility of moving towards a human-centric functional tree instead of a tree based on technical features. In order words, be forwards compatible with https://github.com/nixpkgs-architecture/issues/issues/5#issuecomment-1228656788 so that that could be implemented with minimal maintenance impact.

Closes #3
Closes #6

@roberth
Copy link
Contributor Author

roberth commented Oct 14, 2022

Also it opens up default.nix which only has technical benefits for use as an entrypoint, e.g. for libraries such as for config file generation; such as those discussed in NixOS/rfcs#78

README.md Outdated
Comment on lines 116 to 126
- Use `package.nix` instead of `package-function.nix`
- Makes the migration to a non-function form of overridable packages harder in the future. We'd like to use `package.nix` for a package format that's based on a fixpoint rather than a function, because that will make overriding simpler.

- Use `default.nix` instead of `package-function.nix`
- `default.nix`'s only benefits do not apply
- removing the need to specify the file name in expressions, but this does not apply because we have to do this at most once in the code that replaces definitions from `all-packages.nix`.
- removing the need to specify the file name on the command line, but this does not apply because a package function must be imported into an expression before it can be used, making `nix build -f pkg/hello` equally broken regardless of file name.
- Choosing `default.nix` would bias the purpose of the `pkg` directory to serve only as package definitions, whereas we could make the tree more human friendly by grouping files together by "topic" rather than by technical delineations. For instance, having a package definition, changelog, package-specific config generator and perhaps even NixOS module in one directory makes work on the package in a broad sense easier. This is not a goal of this RFC, but a motivation to make this a future possibility.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convincing! 👍

@infinisil
Copy link
Member

How about package-fun.nix? It's not ambiguous and much shorter

@roberth
Copy link
Contributor Author

roberth commented Nov 11, 2022

How about package-fun.nix? It's not ambiguous and much shorter

Sounds fun 👍

roberth and others added 6 commits November 14, 2022 17:26
The shorter layout is slightly easier to use.
By using `package.nix` we clarify the purpose and format of the expression file, and open up to the possibility of moving towards a human-centric _functional_ tree instead of a tree based on technical features. In order words, be forwards compatible with https://github.com/nixpkgs-architecture/issues/issues/5#issuecomment-1228656788 so that that could be implemented with minimal maintenance impact.
@infinisil
Copy link
Member

@infinisil infinisil merged commit b9adc8f into master Nov 14, 2022
@infinisil infinisil deleted the improve-paths branch November 14, 2022 21:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't auto-callPackage Don't have an auto directory
3 participants