{
  description = "EK-TM4C123GXL (Tiva C) board RTIC dev flake";

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

  outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        overlays = [ rust-overlay.overlays.default ];
        pkgs = import nixpkgs { inherit system overlays; };

        rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain:
          toolchain.default.override {
            targets = [ "thumbv7em-none-eabihf" ];
            extensions = [ "rust-src" "llvm-tools-preview" ];
          });

      in {
        devShells.default = pkgs.mkShell {
          name = "tm4c-rtic-dev";
          packages = with pkgs; [
            rust
            cargo-binutils
            flip-link
            gcc-arm-embedded
            openocd
            cargo-generate
	    rust-analyzer
          ];

          shellHook = ''
            echo ">>> EK-TM4C123GXL RTIC DevShell ready."
            rustc --version
	    echo "openocd -f board/ek-tm4c123gxl.cfg -c "program target/thumbv7em-none-eabihf/debug/scheduler verify reset exit""
          '';
        };
      });
}
