summaryrefslogtreecommitdiff
path: root/flake.nix
blob: 8008d76b316e879e092285ea1b960ff5ed62fc98 (plain)
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
{
  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}";
    });
  };
}