From 90ad9d652f009a53b57115c924446baf6f1d3b7b Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 7 Jan 2024 20:42:07 -0500 Subject: feat: use nix to build images this should result in smaller images, as well as safer updates --- flake.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') 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}"; + }); + }; +} -- cgit v1.2.3