summaryrefslogtreecommitdiff
path: root/flake.nix
blob: c956f579a1933f43bc3e3342b721a442e04fd336 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  description = "getchoo's modpack";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    packwiz2nix.url = "github:getchoo/packwiz2nix";
  };

  outputs = {
    self,
    nixpkgs,
    packwiz2nix,
    ...
  }: let
    version = self.lastModifiedDate;
    systems = [
      "x86_64-linux"
      "aarch64-linux"
      "x86_64-darwin"
      "aarch64-darwin"
    ];

    forAllSystems = nixpkgs.lib.genAttrs systems;
    nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
  in {
    apps = forAllSystems (s: let
      pkgs = nixpkgsFor.${s};
    in {
      generate-checksums = packwiz2nix.lib.mkChecksumsApp pkgs ./mods;
    });

    packages = forAllSystems (s: let
      pkgs = nixpkgsFor.${s};
    in rec {
      getchoo-modpack = pkgs.callPackage ./nix {inherit version;};
      default = getchoo-modpack;
    });

    devShells = forAllSystems (s: let
      pkgs = nixpkgsFor.${s};
      inherit (pkgs) mkShell;
    in {
      default = mkShell {
        packages = with pkgs; [
          packwiz
          p7zip
        ];
      };
    });
  };
}