Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nix): improve flake.nix, follows nixpkgs #1246

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

bryango
Copy link
Contributor

@bryango bryango commented Feb 21, 2024

This patch tries to improve the flake.nix file and brings in nixpkgs updates. The changes may seem overwhelming at first, but they are organized into the following commits, each can be easily reviewed and approved (or rejected):

  • Flatten the flake outputs for clarity, and use the updated flake entries instead of the deprecated ones:
    • packages.${system}.default instead of defaultPackage
    • overlays.default instead of overlay.
  • Reuse nixpkgs definition for git-branchless, and supply local changes through overrides. This ensures that nixpkgs updates such as git-branchless: install man pages NixOS/nixpkgs#289324 are automatically propagated to the package definition here. Some comments are added to direct people to contribute to nixpkgs for the package definition.
  • Reuse git-branchless packaging for scm-diff-editor, since their package definitions are almost identical.
  • Bump nixpkgs flake.lock. With the above changes in place this automatically pulls in the nixpkgs update git-branchless: install man pages NixOS/nixpkgs#289324 (this is actually my PR, guilty haha).

Pinging @thoughtpolice and @hmenke if they are interested in a review!

flake.nix Show resolved Hide resolved
@bryango
Copy link
Contributor Author

bryango commented Feb 21, 2024

Added some comments to direct people to contribute to nixpkgs for the package definition, and rebased.

Also, use updated flake outputs instead of the deprecated ones:
- `packages.${system}.default` instead of `defaultPackage`
- `overlays.default` instead of `overlay`.

See: https://nixos.org/manual/nix/unstable/release-notes/rl-2.7.html
Reuse nixpkgs definition for git-branchless, and supply local changes
through overrides. This ensures that nixpkgs updates are automatically
propagated to the package definition here.

In flake.nix we recommend people to contribute to nixpkgs first for it
to be the primary source of package definition; and then pull the
changes down here by updating flake.lock.
Since the package definition for scm-diff-editor is almost identical
to git-branchless, we reuse the code to avoid duplication and improve
coherence.
This includes upstream updates for git-branchless to install the man pages.
@arxanas
Copy link
Owner

arxanas commented Feb 23, 2024

I can't read Nix so I'll just trust @hmenke and CI 😇

@arxanas arxanas merged commit 50510a0 into arxanas:master Feb 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants