merge base_project
This commit is contained in:
76
flake.nix
76
flake.nix
@@ -1,50 +1,54 @@
|
||||
{
|
||||
description = "pentatrack flake";
|
||||
description = "PentaTrack DevEnv";
|
||||
|
||||
inputs = {
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
inputs.utils.url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs = { self, utils, nixpkgs }:
|
||||
outputs = { self, nixpkgs, utils, ... }:
|
||||
utils.lib.eachSystem [ "i686-linux" "x86_64-linux" ]
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
ARDUINO_PATH="${pkgs.arduino-core}";
|
||||
let
|
||||
libstm32cubef1 = with pkgs; stdenv.mkDerivation {
|
||||
name = "stm32CubeF1";
|
||||
|
||||
shellHok = ''
|
||||
echo "entering pentatrack devenv"
|
||||
export PATH="$PATH:${pkgs.arduino-core}/share/arduino/"
|
||||
src = fetchFromGitHub {
|
||||
owner = "STMicroelectronics";
|
||||
repo = "STM32CubeF1";
|
||||
rev = "c750eab6990cac35ab05020793b0221ecc1a8ce5";
|
||||
sha256 = "sha256-ICGgQCkY5E5Lcd7+U+hX5+MJcTF7J51NFDx6iy/SfgA=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r ./* $out
|
||||
'';
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python310Packages.grip
|
||||
arduino
|
||||
arduino-cli
|
||||
];
|
||||
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
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
# here some compiler commands would be necessary i guess lul
|
||||
#packages.PentaTrack = pkgs.mkDerivation rec {
|
||||
# name = "PentaTrack_v${version}";
|
||||
# src = ./.;
|
||||
# version = "0.1.0";
|
||||
|
||||
# ARDUINO_PATH="${pkgs.arduino-core}";
|
||||
|
||||
# buildInputs = with pkgs; [
|
||||
# arduino
|
||||
# ];
|
||||
|
||||
# shellHook = ''
|
||||
# export PATH="$PATH:${pkgs.arduino-core}/share/arduino/"
|
||||
# '';
|
||||
#};
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShell = import ./shell.nix {
|
||||
inherit pkgs;
|
||||
libstm32cube = libstm32cubef1;
|
||||
libstm32stdperiph = libstm32stdperiph;
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user