Giter Club home page Giter Club logo

Comments (3)

DavHau avatar DavHau commented on July 4, 2024 1

I did it now a bit different. Alternative 2 has the problem that the other version attributes will be mixed with all other stuff which the derivation passes through. This would be bad for automation. Therefore I went for:
Alternative 3:

packages.{system} = {
  foo = {latest-foo-package};
  foo.versions."1.0.0" = ...;
  foo.versions."1.2.0" = ...;
}

from dream2nix.

DavHau avatar DavHau commented on July 4, 2024

Thanks for looking into this. The design is not finalized yet. I totally agree this must be changed. I currently have 2 alternative schemas in mind. Let me know about your opinion.

Alternative 1 (package name and version in attribute name):

packages.{system} = {
  foo-latest = {latest-foo-package};
  "foo-1.0.0" = ...;
  "foo-1.2.0" = ...;
}

Alternative 2 (one attribute for latest package; other versions inside passthru of latest):

packages.{system} = {
  foo = {latest-foo-package};
  foo."1.0.0" = ...;
  foo."1.2.0" = ...;
}

Alternative 1 makes all attributes clearly visible on the top level.
Alternative 2 is better for automation tools which want to simply list all available versions for a specific package.
Maybe we should do a mix of 1 & 2.

from dream2nix.

danth avatar danth commented on July 4, 2024

I prefer the second alternative because it is more obvious which is the canonical version of the package. Also, it avoids exporting the same derivation under two different attributes (foo-latest and foo-1.2.0 in this example).

The first schema would be more suitable for the checks output, if you choose to provide that, as it means each individual version is tested by nix flake check.

from dream2nix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.