{
  inputs = {
    dream2nix.url = "github:nix-community/dream2nix";
    nixpkgs.follows = "dream2nix/nixpkgs";
  };

  outputs = {
    self,
    dream2nix,
    nixpkgs,
  }: let
    eachSystem = nixpkgs.lib.genAttrs [
      "aarch64-darwin"
      "aarch64-linux"
      "x86_64-darwin"
      "x86_64-linux"
    ];
  in {
    packages = eachSystem (system: let
      pkgs = nixpkgs.legacyPackages.${system};
    in rec {
      hcpy-raw = dream2nix.lib.evalModules {
        packageSets.nixpkgs = pkgs;
        modules = [
          ./package.nix
          {
            paths.projectRootFile = "flake.nix";
            paths.projectRoot = ./.;
            paths.package = ./.;
          }
        ];
      };

      hcpy = pkgs.callPackage ./wrapper.nix {inherit hcpy-raw;};

      default = hcpy;
    });
  };
}
