This commit is contained in:
2022-12-18 15:37:26 +01:00
commit 514670e897
39 changed files with 6060 additions and 0 deletions

54
flake.nix Normal file
View File

@@ -0,0 +1,54 @@
{
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;
};
}
);
}