summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..c956f57
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,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
+ ];
+ };
+ });
+ };
+}