forked from pedorich-n/MinecraftModpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
86 lines (76 loc) · 2.4 KB
/
flake.nix
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
description = "FabricModpack";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
packwiz2nix = {
url = "github:getchoo/packwiz2nix/rewrite";
inputs.nixpkgs.follows = "nixpkgs";
};
packwiz2nixMain.url = "github:Joaqim/packwiz2nix/?ref=fix/sanitize-store-paths";
};
outputs = inputs @ {
flake-parts,
systems,
packwiz2nix,
packwiz2nixMain,
self,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} ({moduleWithSystem, ...}: {
systems = import systems;
perSystem = {
system,
pkgs,
config,
lib,
...
}: {
_module.args = {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(import ./nix/overlay.nix)
];
};
};
apps = {
generate-checksums = packwiz2nixMain.lib.mkChecksumsApp pkgs ./mods;
};
packages = let
inherit (packwiz2nix.lib.${system}) fetchPackwizModpack;
inherit (packwiz2nixMain.lib) mkMultiMCPack mkPackwizPackages mkChecksums;
# For Modpack Devolopers:
# These builds expects *Double Invocation*
# Without a proper hash, the first build _will_ fail.
# The failed result will tell you the expected `hash` to assign below.
# When you've set the hash, the next build will return with a `/nix/store` entry of the results,
# symlinked as `./result`.
packwiz-pack-hash = "sha256-rFW8hAIYNEfDO537hgQoSuusbedhZbVZsCBGeIo8BUo=";
modrinth-pack-hash = "sha256-VZd7raomyATS4+H9A+IkXoEizEEZcmpnddnu4Wn79Fo=";
in {
packwiz-server = fetchPackwizModpack {
manifest = "${self}/pack.toml";
hash = packwiz-pack-hash;
side = "server";
};
modrinth-pack = pkgs.callPackage ./nix/packwiz-modrinth.nix {
src = self;
hash = modrinth-pack-hash;
};
/*
multimc-pack = let
checksums = mkChecksums pkgs ./mods;
mods = mkPackwizPackages pkgs checksums;
in
mkMultiMCPack {
inherit pkgs mods;
name = "Joaqim-s-Minecraft-Modpack";
};
*/
};
checks = config.packages;
};
});
}