{
  description = "Rust shells";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

  outputs = inputs @ {...}: let
    additionalPackages = [
      pkgs.qemu
      pkgs.xorriso
    ];
    pkgs = import inputs.nixpkgs {
      system = "x86_64-linux";
      overlays = [(import inputs.rust-overlay)];
    };

    rustup = {
      package = pkgs.rustup;
      path = "${pkgs.rustup}/lib/rustlib.src/rust/library";
    };
  in {
    devShell.x86_64-linux = pkgs.mkShell {
      packages = [
        rustup.package
        additionalPackages
      ];
      env = {
        RUST_SRC_PATH = rustup.path;
      };
    };
  };
}
