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

Recommendation: Package as a derivation #1

Open
sarahec opened this issue Sep 12, 2024 · 4 comments
Open

Recommendation: Package as a derivation #1

sarahec opened this issue Sep 12, 2024 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@sarahec
Copy link

sarahec commented Sep 12, 2024

Since not everyone uses flakes, why not package your code in a derivation (using stdenv for the build phases)? You can use callPackage(path-to-derivation) to import it into the flake and ship both.

@coder-labeler coder-labeler bot added enhancement New feature or request question Further information is requested labels Sep 12, 2024
@kylecarbs
Copy link
Member

Good idea. Will do now!

@kylecarbs
Copy link
Member

@sarahec this is as simple as adding a default.nix with flake-compat, right?

(import (
  fetchTarball {
    url = "https://github.com/edolstra/flake-compat/archive/12c64ca55c1014cdc1b16ed5a804aa8576601ff2.tar.gz";
    sha256 = "0jm6nzb83wa6ai17ly9fzpqc40wg1viib8klq8lby54agpl213w5";
  }
) {
  src = ./.;
}).defaultNix

@sarahec
Copy link
Author

sarahec commented Sep 12, 2024

That default.nix loads flake-compat for use in your flake.

I'm talking about the other way around: creating a straight derivation (e.g. package.nix) that could be used by itself or incorporated with callPackage(path-to-derivation)

@kylecarbs
Copy link
Member

Ahh, I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants