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

Find a way to create packages the nix way #2

Open
ivandimitrov8080 opened this issue Oct 8, 2024 · 0 comments
Open

Find a way to create packages the nix way #2

ivandimitrov8080 opened this issue Oct 8, 2024 · 0 comments
Assignees

Comments

@ivandimitrov8080
Copy link
Owner

Package definitions should be written with callPackage if possible, rather than inline in flake.nix, since using package.nix makes them into small, composable, configurable, and portable units of software. Also, by using callPackage and writing in nixpkgs style, it becomes a lot easier to move packages between projects, and indeed to upstream them to nixpkgs, since they look and work a familiar way.

{ # receives(*) pkgs.hello and pkgs.stdenv
  hello, stdenv,
  # can be overridden with `yourPackage.override { enableSomething = true; }`
  enableSomething ? false
}:
stdenv.mkDerivation (finalAttrs: {
  # optional finalAttrs to refer to the set below; preferred over using `rec` attr sets
  # ...
})

from here

@ivandimitrov8080 ivandimitrov8080 self-assigned this Oct 8, 2024
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

No branches or pull requests

1 participant