Skip to content

Make handling system parameter more ergonomic #3843

@Mic92

Description

@Mic92

Is your feature request related to a problem? Please describe.

Right now one has to explicitly define system in flake outputs.
The nix flake itself already comes with boiler code like this:

outputs = { self } : let # ... forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); { defaultPackage = forAllSystems (system: self.packages.${system}.nix);; }; 

I think having to use that much code hurts portability of the ecosystem because people
will only specify the minimum and there seems no easy way of overriding it without changing the
flake itself.

Describe the solution you'd like

outputs = { self, system } : { defaultPackage.${system} = self.packages.${system}; }; 

Describe alternatives you've considered

Use boilercode in every project or rely on external libraries like https://github.com/numtide/flake-utils

If someone needs to explicitly specify platforms i.e. to build packages for different architectures with hydra this should be still possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flakessignificantNovel ideas, large API changes, notable refactorings, issues with RFC potential, etc.

    Type

    No type

    Projects

    Status

    Defined work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions