{
  description = "Nix sandbox for CS4306 assignments";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    systems.url = "github:nix-systems/default";
  };

  outputs = { self, nixpkgs, systems, ... }:
    let
      subdirs = [
        "assignment1"
      ];

      eachSystem = nixpkgs.lib.genAttrs (import systems);
    in {
      packages = eachSystem (system:
        let pkgs = nixpkgs.legacyPackages.${system};
        in pkgs.lib.mergeAttrsList
          (builtins.map (d:
            builtins.mapAttrs
              (_: v: pkgs.callPackage v {})
              (import ./${d}))
            subdirs));

      devShells = eachSystem (system:
        let pkgs = nixpkgs.legacyPackages.${system};
        in {
          default = pkgs.callPackage ./shell.nix {};
        });
    };
}
