IssueRaiser

Make handling system parameter more ergonomic

**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.

Posted by Mic92 on Jul 21, 2020, 6:54 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

github (Software)

Make handling system parameter more ergonomic

Mic92Jul 21, 2020, 6:54 AM

**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.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue