55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{
|
|
description = "STM32 Dev";
|
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
outputs = { self, nixpkgs, utils, ... }:
|
|
utils.lib.eachSystem [ "i686-linux" "x86_64-linux" ]
|
|
(system:
|
|
let
|
|
libstm32cubef1 = with pkgs; stdenv.mkDerivation {
|
|
name = "stm32CubeF1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "STMicroelectronics";
|
|
repo = "STM32CubeF1";
|
|
rev = "c750eab6990cac35ab05020793b0221ecc1a8ce5";
|
|
sha256 = "sha256-ICGgQCkY5E5Lcd7+U+hX5+MJcTF7J51NFDx6iy/SfgA=";
|
|
};
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp -r ./* $out
|
|
'';
|
|
};
|
|
|
|
libstm32stdperiph = with pkgs; stdenv.mkDerivation {
|
|
name = "stm32f10x-stdperiph-lib";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "wajatimur";
|
|
repo = "stm32f10x-stdperiph-lib";
|
|
rev = "master";
|
|
sha256 = "sha256-aLXLe9bT0XbQohfSCWZcRfVvDkUreqKboqUUFkNPkzg=";
|
|
};
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
cp -r ./* $out
|
|
'';
|
|
|
|
};
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
in
|
|
{
|
|
devShell = import ./shell.nix {
|
|
inherit pkgs;
|
|
libstm32cube = libstm32cubef1;
|
|
libstm32stdperiph = libstm32stdperiph;
|
|
};
|
|
}
|
|
);
|
|
}
|