{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
  };

  outputs =
    {
      self,
      nixpkgs,
    }:
    let
      forEachSystem =
        fn:
        nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (
          system: fn system (nixpkgs.legacyPackages.${system})
        );
    in
    {
      devShells = forEachSystem (
        system: pkgs: {
          default = pkgs.mkShell {
            nativeBuildInputs = with pkgs; [
              cargo
              rustc
              pkgconf
            ];

            buildInputs = with pkgs; [
              libGL
              xkeyboard_config
              libgbm
              pango
              udev
              libinput
              shaderc
              libglvnd
              vulkan-loader
            ];

            SHADERC_LIB_DIR = "${pkgs.lib.getLib pkgs.shaderc}/lib";

            shellHook = ''
              unset JAY_CONFIG_DIR
            '';

            LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (
              with pkgs;
              [
                libglvnd
                vulkan-loader
              ]
            );
          };

          dev = pkgs.mkShell {
            inputsFrom = [ self.devShells.${system}.default ];
            nativeBuildInputs = with pkgs; [
              rust-analyzer
              rustfmt
              clippy
            ];
          };
        }
      );

      packages = forEachSystem (
        system: pkgs: {
          default = pkgs.jay.overrideAttrs (_: {
            pname = "wry";
            version = "unstable-${toString self.lastModified}";
            src = ./.;
            cargoDeps = pkgs.rustPlatform.importCargoLock {
              lockFile = ./Cargo.lock;
            };
          });
        }
      );

    };
}
