pololu / nixcrpkgs

Tools for cross-compiling standalone applications using Nix.
Other
200 stars 17 forks source link

Add flake support #7

Closed mkg20001 closed 3 years ago

mkg20001 commented 3 years ago

This adds a basic flake.nix for exposing nixcrpkgs as a flake

Also changed builtins.currentSystem to nixpkgs.system (which works mostly the same, as we only use nixpkgs for currentSystem)

nixpkgs has to be specified explicitly as builtins.currentSystem is no longer available in flakes

ryantm commented 3 years ago

Thanks for the contribution, @mkg20001. This flake does not seem to follow the standard Flake output schema documented in the "Output schema" section of the unofficial NixOS wiki. If we are going to deviate from that schema, we need a good reason. I haven't thought too hard, but probably nixcrpkgs should be in the packages output. Also, flakes outputs usually have a system architecture in their attrpath, which might require more changes.

mkg20001 commented 3 years ago

The architecture is set by nixpkgs that is passed to the function. It makes it harder to use custom nixpkgs with custom overlays as input if we do something like is usually done and make packages.x86-64_linux = nixcrpkgs { nixpkgs = (import nixpkgs { system = "x86-64_linux"; }) }

lib is an attribute that nixos/nixpkgs flake has and it's an attrset that contains functions, so I'd say that this is not a derivation.

ryantm commented 3 years ago

Thanks for pointing out lib in nixpkgs; we'll merge this. We can revisit it later when Flakes is more stable.