reformat with nixfmt-rfc-style

This commit is contained in:
Artemis Tosini 2024-06-06 00:11:34 +00:00
parent 99c062b6af
commit 4ff4e7b859
Signed by: artemist
GPG key ID: ADFFE553DCBB831E
22 changed files with 444 additions and 215 deletions

View file

@ -6,8 +6,14 @@
utils.url = "github:numtide/flake-utils"; utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, utils }: outputs =
utils.lib.eachDefaultSystem (system: {
self,
nixpkgs,
utils,
}:
utils.lib.eachDefaultSystem (
system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -15,27 +21,38 @@
}; };
inherit (pkgs) lib; inherit (pkgs) lib;
names = builtins.attrNames (self.overlays.default pkgs pkgs); names = builtins.attrNames (self.overlays.default pkgs pkgs);
in { in
{
devShells = { devShells = {
plotter = pkgs.callPackage ./shells/plotter { }; plotter = pkgs.callPackage ./shells/plotter { };
ryujinx = pkgs.callPackage ./shells/ryujinx { }; ryujinx = pkgs.callPackage ./shells/ryujinx { };
zephyr = pkgs.callPackage ./shells/zephyr { }; zephyr = pkgs.callPackage ./shells/zephyr { };
}; };
formatter = pkgs.nixfmt; formatter = pkgs.nixfmt-rfc-style;
packages = builtins.listToAttrs (lib.concatMap (name: packages = builtins.listToAttrs (
let pkg = pkgs.${name}; lib.concatMap (
in lib.optional (builtins.typeOf pkg == "set") { name:
let
pkg = pkgs.${name};
in
lib.optional (builtins.typeOf pkg == "set") {
inherit name; inherit name;
value = if lib.isDerivation pkg then value =
if lib.isDerivation pkg then
pkg pkg
else else
pkg // { pkg
// {
type = "derivation"; type = "derivation";
name = "dummy-attrset"; name = "dummy-attrset";
}; };
}) names); }
}) // { ) names
);
}
)
// {
overlays.default = final: prev: { overlays.default = final: prev: {
attic = final.callPackage ./packages/attic { }; attic = final.callPackage ./packages/attic { };
attic-client = final.attic.override { clientOnly = true; }; attic-client = final.attic.override { clientOnly = true; };
@ -52,25 +69,19 @@
axidraw = final.callPackage ./packages/axidraw/inkscape.nix { }; axidraw = final.callPackage ./packages/axidraw/inkscape.nix { };
}; };
kernelPatches = prev.kernelPatches kernelPatches = prev.kernelPatches // final.callPackage ./packages/kernelPatches { };
// final.callPackage ./packages/kernelPatches { };
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(pythonFinal: pythonPrev: (
pythonFinal: pythonPrev:
{ {
pnoise = final.callPackage ./packages/pnoise { pnoise = final.callPackage ./packages/pnoise { python3 = pythonFinal; };
python3 = pythonFinal; vpype = final.callPackage ./packages/vpype { python3 = pythonFinal; };
}; vpype-gcode = final.callPackage ./packages/vpype-gcode { python3 = pythonFinal; };
vpype = }
final.callPackage ./packages/vpype { python3 = pythonFinal; }; // (final.callPackage ./packages/axidraw/modules.nix { python3 = pythonFinal; })
vpype-gcode = final.callPackage ./packages/vpype-gcode { )
python3 = pythonFinal;
};
} // (final.callPackage ./packages/axidraw/modules.nix {
python3 = pythonFinal;
}))
]; ];
}; };
}; };
} }

View file

@ -1,14 +1,28 @@
# Based on original package.nix from zhaofengli # Based on original package.nix from zhaofengli
{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, installShellFiles, nix {
, boost, darwin lib,
stdenv,
rustPlatform,
fetchFromGitHub,
pkg-config,
installShellFiles,
nix,
boost,
darwin,
# Only build the client # Only build the client
, clientOnly ? false clientOnly ? false,
# Only build certain crates # Only build certain crates
, crates ? crates ?
if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ] if clientOnly then
[ "attic-client" ]
else
[
"attic-client"
"attic-server"
],
}: }:
rustPlatform.buildRustPackage { rustPlatform.buildRustPackage {
@ -27,25 +41,27 @@ rustPlatform.buildRustPackage {
allowBuiltinFetchGit = true; allowBuiltinFetchGit = true;
}; };
nativeBuildInputs = [ pkg-config installShellFiles ]; nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = [ nix boost ] ++ lib.optionals stdenv.isDarwin buildInputs = [
(with darwin.apple_sdk.frameworks; [ SystemConfiguration ]); nix
boost
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]);
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
ATTIC_DISTRIBUTOR = "artemist"; ATTIC_DISTRIBUTOR = "artemist";
# Workaround for https://github.com/NixOS/nixpkgs/issues/166205 # Workaround for https://github.com/NixOS/nixpkgs/issues/166205
env = lib.optionalAttrs stdenv.cc.isClang { env = lib.optionalAttrs stdenv.cc.isClang { NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; };
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
};
# Recursive Nix is not stable yet # Recursive Nix is not stable yet
doCheck = false; doCheck = false;
postInstall = postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
if [[ -f $out/bin/attic ]]; then if [[ -f $out/bin/attic ]]; then
installShellCompletion --cmd attic \ installShellCompletion --cmd attic \
--bash <($out/bin/attic gen-completions bash) \ --bash <($out/bin/attic gen-completions bash) \

View file

@ -1,12 +1,16 @@
{ stdenv, lib, fetchzip, autoPatchelfHook }: {
stdenv,
lib,
fetchzip,
autoPatchelfHook,
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "axidraw-inkscape"; pname = "axidraw-inkscape";
version = "394"; version = "394";
src = fetchzip { src = fetchzip {
url = url = "https://cdn.evilmadscientist.com/dl/ad/public/${version}/AxiDraw_${version}_LinX86.zip";
"https://cdn.evilmadscientist.com/dl/ad/public/${version}/AxiDraw_${version}_LinX86.zip";
hash = "sha256-LoNi7mR30spELnEYikRuYFvlgUWP3w8KRbQ6Ug108vU="; hash = "sha256-LoNi7mR30spELnEYikRuYFvlgUWP3w8KRbQ6Ug108vU=";
}; };
@ -23,8 +27,7 @@ stdenv.mkDerivation rec {
meta = with lib; { meta = with lib; {
description = "Inkscape extension for managing axidraw"; description = "Inkscape extension for managing axidraw";
homepage = homepage = "https://wiki.evilmadscientist.com/Axidraw_Software_Installation";
"https://wiki.evilmadscientist.com/Axidraw_Software_Installation";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = with maintainers; [ artemist ]; maintainers = with maintainers; [ artemist ];
platforms = [ "x86_64-linux" ]; platforms = [ "x86_64-linux" ];

View file

@ -1,22 +1,26 @@
{ python3, fetchPypi, fetchzip, fetchurl }: {
python3,
fetchPypi,
fetchzip,
fetchurl,
}:
let let
inherit (python3) buildPythonPackage; inherit (python3) buildPythonPackage;
axicliVersion = "3.9.0"; axicliVersion = "3.9.0";
axicliVer = builtins.replaceStrings [ "." ] [ "" ] axicliVersion; axicliVer = builtins.replaceStrings [ "." ] [ "" ] axicliVersion;
axicliSrc = fetchzip { axicliSrc = fetchzip {
url = url = "https://github.com/evil-mad/axidraw/releases/download/v${axicliVersion}/AxiDraw_API_${axicliVer}.zip";
"https://github.com/evil-mad/axidraw/releases/download/v${axicliVersion}/AxiDraw_API_${axicliVer}.zip";
hash = "sha256-RPh00jiiH1RqqKZ10ylFP1J+iBYl5VOmZ8g0vFH8Ibg="; hash = "sha256-RPh00jiiH1RqqKZ10ylFP1J+iBYl5VOmZ8g0vFH8Ibg=";
}; };
in { in
{
drawsvg = buildPythonPackage { drawsvg = buildPythonPackage {
pname = "drawsvg"; pname = "drawsvg";
version = "2.3.0"; version = "2.3.0";
format = "wheel"; format = "wheel";
src = fetchurl { src = fetchurl {
url = url = "https://files.pythonhosted.org/packages/27/4f/65d72a014026495d8d2847e66bbe542cf899e50f087a50e0abab9c58ef3c/drawsvg-2.3.0-py3-none-any.whl";
"https://files.pythonhosted.org/packages/27/4f/65d72a014026495d8d2847e66bbe542cf899e50f087a50e0abab9c58ef3c/drawsvg-2.3.0-py3-none-any.whl";
sha256 = "1gqa5q5b7y38isyw1kgq2lprw5709jv13pic9s6bk80dbm32pbck"; sha256 = "1gqa5q5b7y38isyw1kgq2lprw5709jv13pic9s6bk80dbm32pbck";
}; };
}; };
@ -39,15 +43,17 @@ in {
hash = "sha256-YxSASXBNXqRyGp7x6jlTU0UYJHJkiKdlEzfDMzUtKXk="; hash = "sha256-YxSASXBNXqRyGp7x6jlTU0UYJHJkiKdlEzfDMzUtKXk=";
}; };
doCheck = false; doCheck = false;
propagatedBuildInputs = with python3; [ ink-extensions pyserial ]; propagatedBuildInputs = with python3; [
ink-extensions
pyserial
];
}; };
axidrawinternal = buildPythonPackage { axidrawinternal = buildPythonPackage {
pname = "axidrawinternal"; pname = "axidrawinternal";
version = axicliVersion; version = axicliVersion;
format = "wheel"; format = "wheel";
src = src = "${axicliSrc}/prebuilt_dependencies/axidrawinternal-${axicliVersion}-py2.py3-none-any.whl";
"${axicliSrc}/prebuilt_dependencies/axidrawinternal-${axicliVersion}-py2.py3-none-any.whl";
propagatedBuildInputs = with python3; [ propagatedBuildInputs = with python3; [
ink-extensions ink-extensions
requests requests

View file

@ -1,4 +1,13 @@
{ stdenv, lib, fetchFromGitHub, autoconf, automake, boost, cups, ... }: {
stdenv,
lib,
fetchFromGitHub,
autoconf,
automake,
boost,
cups,
...
}:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "cups-dymo"; pname = "cups-dymo";
@ -11,9 +20,15 @@ stdenv.mkDerivation {
hash = "sha256-IwdTJxCOKyqsl1B5UQqCDpepz04U4VF+G3mqaJTQJ/w="; hash = "sha256-IwdTJxCOKyqsl1B5UQqCDpepz04U4VF+G3mqaJTQJ/w=";
}; };
nativeBuildInputs = [ autoconf automake ]; nativeBuildInputs = [
autoconf
automake
];
buildInputs = [ boost cups ]; buildInputs = [
boost
cups
];
preConfigure = '' preConfigure = ''
touch NEWS AUTHORS INSTALL README ChangeLog touch NEWS AUTHORS INSTALL README ChangeLog

View file

@ -1,4 +1,9 @@
{ lib, buildDotnetModule, dotnetCorePackages, fetchFromGitHub }: {
lib,
buildDotnetModule,
dotnetCorePackages,
fetchFromGitHub,
}:
buildDotnetModule rec { buildDotnetModule rec {
pname = "hactoolnet"; pname = "hactoolnet";
@ -22,8 +27,7 @@ buildDotnetModule rec {
meta = with lib; { meta = with lib; {
homepage = "https://github.com/Thealexbarney/LibHac"; homepage = "https://github.com/Thealexbarney/LibHac";
description = description = "Example program for LibHac, which implements parts of Horizon OS";
"Example program for LibHac, which implements parts of Horizon OS";
license = licenses.mit; license = licenses.mit;
platforms = platforms.unix; platforms = platforms.unix;
}; };

View file

@ -1,7 +1,8 @@
# This file was automatically generated by passthru.fetch-deps. # This file was automatically generated by passthru.fetch-deps.
# Please dont edit it manually, your changes might get overwritten! # Please dont edit it manually, your changes might get overwritten!
{ fetchNuGet }: [ { fetchNuGet }:
[
(fetchNuGet { (fetchNuGet {
pname = "Microsoft.AspNetCore.App.Ref"; pname = "Microsoft.AspNetCore.App.Ref";
version = "7.0.16"; version = "7.0.16";

View file

@ -1,4 +1,11 @@
{ lib, buildGo122Module, fetchFromGitHub, unicorn, libusb, pkg-config }: {
lib,
buildGo122Module,
fetchFromGitHub,
unicorn,
libusb,
pkg-config,
}:
buildGo122Module rec { buildGo122Module rec {
pname = "ipsw"; pname = "ipsw";
@ -15,14 +22,20 @@ buildGo122Module rec {
patches = [ ./fix-build.patch ]; patches = [ ./fix-build.patch ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ unicorn libusb ]; buildInputs = [
unicorn
libusb
];
ldflags = [ ldflags = [
"-s" "-s"
"-w" "-w"
"-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppVersion=${version}" "-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppVersion=${version}"
"-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppBuildTime=19700101" "-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppBuildTime=19700101"
]; ];
tags = [ "unicorn" "libusb" ]; tags = [
"unicorn"
"libusb"
];
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {

View file

@ -1,10 +1,29 @@
{ stdenv, lib, fetchurl, autoPatchelfHook, fontconfig, freetype, libgcc, libusb {
, libICE, libSM, ncurses5, udev, libX11, libXext, libXcursor, libXfixes stdenv,
, libXrender, libXrandr }: lib,
fetchurl,
autoPatchelfHook,
fontconfig,
freetype,
libgcc,
libusb,
libICE,
libSM,
ncurses5,
udev,
libX11,
libXext,
libXcursor,
libXfixes,
libXrender,
libXrandr,
}:
let let
conf = (lib.importJSON ./version.json).${stdenv.hostPlatform.system} or (throw conf =
"unsupported system ${stdenv.hostPlatform.system}"); (lib.importJSON ./version.json).${stdenv.hostPlatform.system}
in stdenv.mkDerivation rec { or (throw "unsupported system ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec {
pname = "jlink"; pname = "jlink";
version = conf.version; version = conf.version;
@ -52,7 +71,12 @@ in stdenv.mkDerivation rec {
homepage = "https://www.segger.com/downloads/jlink"; homepage = "https://www.segger.com/downloads/jlink";
description = "SEGGER J-Link"; description = "SEGGER J-Link";
license = licenses.unfree; license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" "armv7l-linux" "aarch64-linux" ]; platforms = [
"x86_64-linux"
"i686-linux"
"armv7l-linux"
"aarch64-linux"
];
maintainers = with maintainers; [ artemist ]; maintainers = with maintainers; [ artemist ];
}; };
} }

View file

@ -1,4 +1,5 @@
{ ... }: { { ... }:
{
increase_max_topo = { increase_max_topo = {
name = "increase-max-topo"; name = "increase-max-topo";
patch = ./increase-max-topo.patch; patch = ./increase-max-topo.patch;

View file

@ -1,4 +1,8 @@
{ lib, python3, fetchFromGitHub }: {
lib,
python3,
fetchFromGitHub,
}:
python3.buildPythonPackage rec { python3.buildPythonPackage rec {
pname = "pnoise"; pname = "pnoise";

View file

@ -1,4 +1,9 @@
{ stdenv, fetchFromGitHub, pkg-config, libusb1 }: {
stdenv,
fetchFromGitHub,
pkg-config,
libusb1,
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "stlink-tool"; pname = "stlink-tool";

View file

@ -1,4 +1,8 @@
{ lib, python3, fetchFromGitHub }: {
lib,
python3,
fetchFromGitHub,
}:
python3.buildPythonPackage rec { python3.buildPythonPackage rec {
pname = "vpype"; pname = "vpype";
@ -12,7 +16,11 @@ python3.buildPythonPackage rec {
hash = "sha256-waSHw4DBgozcBwNTgZwGfvmg0UHaENJIGrCqnMu0ruU="; hash = "sha256-waSHw4DBgozcBwNTgZwGfvmg0UHaENJIGrCqnMu0ruU=";
}; };
propagatedBuildInputs = with python3; [ click numpy vpype ]; propagatedBuildInputs = with python3; [
click
numpy
vpype
];
meta = with lib; { meta = with lib; {
description = "gcode extension for vpype"; description = "gcode extension for vpype";

View file

@ -1,4 +1,9 @@
{ lib, python3, fetchFromGitHub, withViewer ? true }: {
lib,
python3,
fetchFromGitHub,
withViewer ? true,
}:
python3.buildPythonPackage rec { python3.buildPythonPackage rec {
pname = "vpype"; pname = "vpype";
@ -15,8 +20,10 @@ python3.buildPythonPackage rec {
nativeBuildInputs = with python3; [ poetry-core ]; nativeBuildInputs = with python3; [ poetry-core ];
propagatedBuildInputs = with python3; propagatedBuildInputs =
([ with python3;
(
[
asteval asteval
cachetools cachetools
click click
@ -29,19 +36,20 @@ python3.buildPythonPackage rec {
svgelements svgelements
svgwrite svgwrite
tomli tomli
] ++ lib.optionals withViewer [ ]
++ lib.optionals withViewer [
glcontext glcontext
matplotlib matplotlib
moderngl moderngl
pillow pillow
pyside6 pyside6
]); ]
);
# No checks since they want OpenGL and a GUI # No checks since they want OpenGL and a GUI
meta = with lib; { meta = with lib; {
description = description = "The Swiss-Army-knife command-line tool for plotter vector graphics";
"The Swiss-Army-knife command-line tool for plotter vector graphics";
homepage = "https://vpype.readthedocs.io/en/latest/"; homepage = "https://vpype.readthedocs.io/en/latest/";
license = with licenses; [ mit ]; license = with licenses; [ mit ];
maintainers = with maintainers; [ artemist ]; maintainers = with maintainers; [ artemist ];

View file

@ -1,19 +1,27 @@
{ callPackage, stdenv, lib, fetchFromGitHub }: {
callPackage,
stdenv,
lib,
fetchFromGitHub,
}:
let let
assets = lib.importJSON ./assets.json; assets = lib.importJSON ./assets.json;
modules = lib.importJSON ./modules.json; modules = lib.importJSON ./modules.json;
buildModule = module: callPackage ./module.nix { inherit module; }; buildModule = module: callPackage ./module.nix { inherit module; };
in { in
{
host-tools = callPackage ./host-tools.nix { host-tools = callPackage ./host-tools.nix {
inherit (assets) version hosts; inherit (assets) version hosts;
sources = assets.host_tools; sources = assets.host_tools;
}; };
toolchains = lib.mapAttrs (target: sources: toolchains = lib.mapAttrs (
target: sources:
callPackage ./toolchain.nix { callPackage ./toolchain.nix {
inherit target sources; inherit target sources;
inherit (assets) version hosts; inherit (assets) version hosts;
}) assets.toolchains; }
) assets.toolchains;
sdk = callPackage ./sdk.nix { sdk = callPackage ./sdk.nix {
inherit (assets) version hosts; inherit (assets) version hosts;

View file

@ -1,9 +1,21 @@
{ stdenv, fetchurl, hosts, lib, python3, sources, version, which }: {
stdenv,
fetchurl,
hosts,
lib,
python3,
sources,
version,
which,
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "zephyr-host-tools"; pname = "zephyr-host-tools";
inherit version; inherit version;
nativeBuildInputs = [ python3 which ]; nativeBuildInputs = [
python3
which
];
src = fetchurl (sources."${stdenv.hostPlatform.system}"); src = fetchurl (sources."${stdenv.hostPlatform.system}");
dontUnpack = true; dontUnpack = true;

View file

@ -1,14 +1,21 @@
{ stdenvNoCC, lib, fetchFromGitHub, symlinkJoin, fetchurl, version ? null {
, module }: stdenvNoCC,
lib,
fetchFromGitHub,
symlinkJoin,
fetchurl,
version ? null,
module,
}:
let let
labeledName = label: labeledName =
if version != null then label: if version != null then "${module.name}-${label}-${version}" else "${module.name}-${label}";
"${module.name}-${label}-${version}" fetchBlob =
else blob:
"${module.name}-${label}"; let
fetchBlob = blob: blobFile = fetchurl { inherit (blob) url sha256; };
let blobFile = fetchurl { inherit (blob) url sha256; }; in
in stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
name = "blob-${blob.path}"; name = "blob-${blob.path}";
passAsFile = [ "buildCommand" ]; passAsFile = [ "buildCommand" ];
buildCommand = '' buildCommand = ''
@ -16,12 +23,21 @@ let
ln -s ${blobFile} $out/${blob.path} ln -s ${blobFile} $out/${blob.path}
''; '';
}; };
baseSrc = fetchFromGitHub { inherit (module) owner repo rev name sha256; }; baseSrc = fetchFromGitHub {
inherit (module)
owner
repo
rev
name
sha256
;
};
blobbedSrc = symlinkJoin { blobbedSrc = symlinkJoin {
name = labeledName "with-blobs"; name = labeledName "with-blobs";
paths = [ baseSrc ] ++ (map fetchBlob module.blobs); paths = [ baseSrc ] ++ (map fetchBlob module.blobs);
}; };
in stdenvNoCC.mkDerivation (finalAttrs: { in
stdenvNoCC.mkDerivation (finalAttrs: {
name = labeledName "wrapped"; name = labeledName "wrapped";
passthru.modulePath = "${finalAttrs.finalPackage.out}/${module.name}"; passthru.modulePath = "${finalAttrs.finalPackage.out}/${module.name}";
@ -32,4 +48,3 @@ in stdenvNoCC.mkDerivation (finalAttrs: {
ln -s ${blobbedSrc} "$out/${module.name}" ln -s ${blobbedSrc} "$out/${module.name}"
''; '';
}) })

View file

@ -1,7 +1,17 @@
{ lib, symlinkJoin, fetchurl, zephyrPackages, source, version, hosts {
, toolchains ? [ ] }: lib,
let src = fetchurl source; symlinkJoin,
in symlinkJoin rec { fetchurl,
zephyrPackages,
source,
version,
hosts,
toolchains ? [ ],
}:
let
src = fetchurl source;
in
symlinkJoin rec {
pname = "zephyr-sdk"; pname = "zephyr-sdk";
inherit version; inherit version;
name = "${pname}-${version}"; name = "${pname}-${version}";

View file

@ -1,4 +1,13 @@
{ stdenv, lib, fetchurl, autoPatchelfHook, target, sources, version, hosts }: {
stdenv,
lib,
fetchurl,
autoPatchelfHook,
target,
sources,
version,
hosts,
}:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "zephyr-toolchain-${target}"; pname = "zephyr-toolchain-${target}";
@ -35,8 +44,7 @@ stdenv.mkDerivation {
meta = with lib; { meta = with lib; {
homepage = "https://www.zephyrproject.org/"; homepage = "https://www.zephyrproject.org/";
description = description = "Toolchain for building Zephyr for the ${target} architecture";
"Toolchain for building Zephyr for the ${target} architecture";
license = licenses.asl20; license = licenses.asl20;
platforms = hosts; platforms = hosts;
maintainers = with maintainers; [ artemist ]; maintainers = with maintainers; [ artemist ];

View file

@ -1,7 +1,14 @@
{ lib, mkShell, python3, inkscape-with-extensions, inkscape-extensions, jupyter {
lib,
mkShell,
python3,
inkscape-with-extensions,
inkscape-extensions,
jupyter,
}: }:
mkShell { mkShell {
packages = [ packages =
[
(inkscape-with-extensions.override { (inkscape-with-extensions.override {
inkscapeExtensions = with inkscape-extensions; [ inkscapeExtensions = with inkscape-extensions; [
silhouette silhouette
@ -11,7 +18,8 @@ mkShell {
}) })
python3 python3
jupyter jupyter
] ++ (with python3.pkgs; [ ]
++ (with python3.pkgs; [
axicli axicli
drawsvg drawsvg
ipython ipython
@ -20,5 +28,4 @@ mkShell {
vpype vpype
vpype-gcode vpype-gcode
]); ]);
} }

View file

@ -1,6 +1,28 @@
{ lib, mkShell, dotnetCorePackages, libX11, libgdiplus, SDL2_mixer, openal {
, libsoundio, sndio, pulseaudio, vulkan-loader, ffmpeg, libICE, libSM, libXi lib,
, libXcursor, libXext, libXrandr, fontconfig, glew, libGL, SDL2, udev }: mkShell,
dotnetCorePackages,
libX11,
libgdiplus,
SDL2_mixer,
openal,
libsoundio,
sndio,
pulseaudio,
vulkan-loader,
ffmpeg,
libICE,
libSM,
libXi,
libXcursor,
libXext,
libXrandr,
fontconfig,
glew,
libGL,
SDL2,
udev,
}:
mkShell { mkShell {
packages = [ packages = [

View file

@ -1,10 +1,32 @@
{ lib, mkShell, zephyrPackages, cmake, ninja, gnumake, python3 {
, toolchains ? with zephyrPackages.toolchains; [ arm-zephyr-eabi ] lib,
, enableWest ? false, zephyrSrc ? zephyrPackages.src, modules ? [ ] mkShell,
, extraPackages ? [ ], extraAttrs ? { } }: zephyrPackages,
let zephyr-sdk = zephyrPackages.sdk.override { inherit toolchains; }; cmake,
in mkShell ({ ninja,
packages = [ cmake ninja gnumake python3 ] ++ (with python3.pkgs; gnumake,
python3,
toolchains ? with zephyrPackages.toolchains; [ arm-zephyr-eabi ],
enableWest ? false,
zephyrSrc ? zephyrPackages.src,
modules ? [ ],
extraPackages ? [ ],
extraAttrs ? { },
}:
let
zephyr-sdk = zephyrPackages.sdk.override { inherit toolchains; };
in
mkShell (
{
packages =
[
cmake
ninja
gnumake
python3
]
++ (
with python3.pkgs;
[ [
# requirements-base.txt # requirements-base.txt
pyelftools pyelftools
@ -19,16 +41,22 @@ in mkShell ({
requests requests
anytree anytree
intelhex intelhex
] ++ lib.optional enableWest python3.pkgs.west ++ extraPackages); ]
++ lib.optional enableWest python3.pkgs.west
++ extraPackages
);
ZEPHYR_TOOLCHAIN_VARIANT = "zephyr"; ZEPHYR_TOOLCHAIN_VARIANT = "zephyr";
ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}"; ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}";
} // lib.optionalAttrs (zephyrSrc != null) { }
// lib.optionalAttrs (zephyrSrc != null) {
ZEPHYR_BASE = "${zephyrSrc}"; ZEPHYR_BASE = "${zephyrSrc}";
shellHook = '' shellHook = ''
PATH="${zephyrSrc}/scripts:$PATH" PATH="${zephyrSrc}/scripts:$PATH"
''; '';
} // lib.optionalAttrs (modules != [ ]) { }
ZEPHYR_MODULES = // lib.optionalAttrs (modules != [ ]) {
lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules); ZEPHYR_MODULES = lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules);
} // extraAttrs) }
// extraAttrs
)