From 74a074543532b63dfc049e6c51fe10e2ea795650 Mon Sep 17 00:00:00 2001 From: seth Date: Thu, 11 May 2023 10:50:21 -0400 Subject: start using packwiz2nix --- flake.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') 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 + ]; + }; + }); + }; +} -- cgit v1.2.3