nix/templates/elixir/nix/boilerplate.nix
Daniel Flanagan d5d4a1d96c
All checks were successful
/ check (push) Successful in 5m16s
Break up flake
2024-12-18 09:30:00 -06:00

16 lines
513 B
Nix

inputs @ {
nixpkgs,
self,
...
}: let
forSelfOverlay =
if builtins.hasAttr "forSelf" self.overlays
then self.overlays.forSelf
else (_: p: p);
in rec {
systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
forSystems = nixpkgs.lib.genAttrs systems;
pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay);
genPkgs = func: (forSystems (system: func (pkgsFor system)));
call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;}));
}