{
  description = "nyazoom: file sharing but with cats";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs@{ nixpkgs, rust-overlay, flake-parts, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      systems = [
        "x86_64-linux"
        "aarch64-darwin"
      ];

      perSystem = { system, pkgs, ... }: {
        _module.args.pkgs = (import nixpkgs {
          inherit system;
          overlays = [ rust-overlay.overlays.default ];
        });
        devShells.default = import ./shell.nix {
          inherit pkgs;
          additionalBuildInputs = [
            (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
              extensions = [ "rust-src" "rust-analyzer" ];
            }))
          ];
        };
        packages.default =
          let rust-bin = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal);
          in pkgs.callPackage ./package.nix {
            rustPlatform = pkgs.makeRustPlatform {
              rustc = rust-bin;
              cargo = rust-bin;
            };
          };
      };
    };
}