diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8008d76 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "a docker image to serve packwiz modpacks"; + + inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + + outputs = { + self, + nixpkgs, + ... + }: let + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + forAllSystems = fn: nixpkgs.lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys}); + in { + formatter = forAllSystems (pkgs: pkgs.alejandra); + + packages = forAllSystems ({ + pkgs, + system, + ... + }: let + containerFor = import ./container.nix pkgs; + arch = pkgs.stdenv.hostPlatform.uname.processor; + in { + container-x86_64 = containerFor "x86_64"; + container-aarch64 = containerFor "aarch64"; + + default = self.packages.${system}."container-${arch}"; + }); + }; +} |
