summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 33e2e02e72b3d69081a737a732db9ca7a3305703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  description = "a tool for generating packages from packwiz modpacks";

  inputs.nixpkgs.url = "nixpkgs/nixos-unstable";

  outputs = {
    nixpkgs,
    self,
    ...
  }: let
    inherit (nixpkgs) lib;

    systems = [
      "x86_64-linux"
      "aarch64-linux"
      "x86_64-darwin"
      "aarch64-darwin"
    ];

    forAllSystems = fn: lib.genAttrs systems (s: fn nixpkgs.legacyPackages.${s});
  in {
    formatter = forAllSystems (pkgs: pkgs.alejandra);

    lib = forAllSystems (pkgs: let
      lib' = lib.makeScope pkgs.newScope (final: self.overlays.default final pkgs);
    in {
      inherit
        (lib')
        fetchPackwizModpack
        mkMultiMCPack
        ;
    });

    overlays.default = final: prev: (import ./lib final prev);
  };
}