From 4ff4e7b8596b29bfabfdfe1a793d20ea2c1f448b Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 6 Jun 2024 00:11:34 +0000 Subject: [PATCH] reformat with nixfmt-rfc-style --- flake.nix | 113 ++++++++++++++++------------- packages/attic/default.nix | 58 +++++++++------ packages/axidraw/inkscape.nix | 13 ++-- packages/axidraw/modules.nix | 24 +++--- packages/cups-dymo/default.nix | 21 +++++- packages/hactoolnet/default.nix | 10 ++- packages/hactoolnet/deps.nix | 3 +- packages/ipsw/default.nix | 19 ++++- packages/jlink/default.nix | 38 ++++++++-- packages/kernelPatches/default.nix | 3 +- packages/pnoise/default.nix | 6 +- packages/stlink-tool/default.nix | 7 +- packages/vpype-gcode/default.nix | 12 ++- packages/vpype/default.nix | 56 ++++++++------ packages/zephyr/default.nix | 16 +++- packages/zephyr/host-tools.nix | 16 +++- packages/zephyr/module.nix | 41 +++++++---- packages/zephyr/sdk.nix | 18 ++++- packages/zephyr/toolchain.nix | 14 +++- shells/plotter/default.nix | 49 +++++++------ shells/ryujinx/default.nix | 28 ++++++- shells/zephyr/default.nix | 94 +++++++++++++++--------- 22 files changed, 444 insertions(+), 215 deletions(-) diff --git a/flake.nix b/flake.nix index 905d4ba..2db559f 100644 --- a/flake.nix +++ b/flake.nix @@ -6,8 +6,14 @@ utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, utils }: - utils.lib.eachDefaultSystem (system: + outputs = + { + self, + nixpkgs, + utils, + }: + utils.lib.eachDefaultSystem ( + system: let pkgs = import nixpkgs { inherit system; @@ -15,62 +21,67 @@ }; inherit (pkgs) lib; names = builtins.attrNames (self.overlays.default pkgs pkgs); - in { + in + { devShells = { plotter = pkgs.callPackage ./shells/plotter { }; ryujinx = pkgs.callPackage ./shells/ryujinx { }; zephyr = pkgs.callPackage ./shells/zephyr { }; }; - formatter = pkgs.nixfmt; - packages = builtins.listToAttrs (lib.concatMap (name: - let pkg = pkgs.${name}; - in lib.optional (builtins.typeOf pkg == "set") { - inherit name; - value = if lib.isDerivation pkg then - pkg - else - pkg // { - type = "derivation"; - name = "dummy-attrset"; - }; - }) names); - }) // { - overlays.default = final: prev: { - attic = final.callPackage ./packages/attic { }; - attic-client = final.attic.override { clientOnly = true; }; - cups-dymo-patched = final.callPackage ./packages/cups-dymo { }; - hactoolnet = final.callPackage ./packages/hactoolnet { }; - ipsw = final.callPackage ./packages/ipsw { }; - jlink = final.callPackage ./packages/jlink { }; - stlink-tool = final.callPackage ./packages/stlink-tool { }; - zephyrPackages = final.callPackage ./packages/zephyr { }; + formatter = pkgs.nixfmt-rfc-style; + packages = builtins.listToAttrs ( + lib.concatMap ( + name: + let + pkg = pkgs.${name}; + in + lib.optional (builtins.typeOf pkg == "set") { + inherit name; + value = + if lib.isDerivation pkg then + pkg + else + pkg + // { + type = "derivation"; + name = "dummy-attrset"; + }; + } + ) names + ); + } + ) + // { + overlays.default = final: prev: { + attic = final.callPackage ./packages/attic { }; + attic-client = final.attic.override { clientOnly = true; }; + cups-dymo-patched = final.callPackage ./packages/cups-dymo { }; + hactoolnet = final.callPackage ./packages/hactoolnet { }; + ipsw = final.callPackage ./packages/ipsw { }; + jlink = final.callPackage ./packages/jlink { }; + stlink-tool = final.callPackage ./packages/stlink-tool { }; + zephyrPackages = final.callPackage ./packages/zephyr { }; - inherit (final.python3.pkgs) axicli vpype; + inherit (final.python3.pkgs) axicli vpype; - inkscape-extensions = prev.inkscape-extensions // { - axidraw = final.callPackage ./packages/axidraw/inkscape.nix { }; - }; - - kernelPatches = prev.kernelPatches - // final.callPackage ./packages/kernelPatches { }; - - pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ - (pythonFinal: pythonPrev: - { - pnoise = final.callPackage ./packages/pnoise { - python3 = pythonFinal; - }; - vpype = - final.callPackage ./packages/vpype { python3 = pythonFinal; }; - vpype-gcode = final.callPackage ./packages/vpype-gcode { - python3 = pythonFinal; - }; - } // (final.callPackage ./packages/axidraw/modules.nix { - python3 = pythonFinal; - })) - ]; + inkscape-extensions = prev.inkscape-extensions // { + axidraw = final.callPackage ./packages/axidraw/inkscape.nix { }; }; - }; -} + kernelPatches = prev.kernelPatches // final.callPackage ./packages/kernelPatches { }; + + pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ + ( + pythonFinal: pythonPrev: + { + pnoise = final.callPackage ./packages/pnoise { python3 = pythonFinal; }; + vpype = final.callPackage ./packages/vpype { python3 = pythonFinal; }; + vpype-gcode = final.callPackage ./packages/vpype-gcode { python3 = pythonFinal; }; + } + // (final.callPackage ./packages/axidraw/modules.nix { python3 = pythonFinal; }) + ) + ]; + }; + }; +} diff --git a/packages/attic/default.nix b/packages/attic/default.nix index 661ece3..37a4739 100644 --- a/packages/attic/default.nix +++ b/packages/attic/default.nix @@ -1,14 +1,28 @@ # 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 -, clientOnly ? false + # Only build the client + clientOnly ? false, # Only build certain crates -, crates ? - if clientOnly then [ "attic-client" ] else [ "attic-client" "attic-server" ] + crates ? + if clientOnly then + [ "attic-client" ] + else + [ + "attic-client" + "attic-server" + ], }: rustPlatform.buildRustPackage { @@ -27,32 +41,34 @@ rustPlatform.buildRustPackage { allowBuiltinFetchGit = true; }; - nativeBuildInputs = [ pkg-config installShellFiles ]; + nativeBuildInputs = [ + pkg-config + installShellFiles + ]; - buildInputs = [ nix boost ] ++ lib.optionals stdenv.isDarwin - (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]); + buildInputs = [ + nix + boost + ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ SystemConfiguration ]); cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; ATTIC_DISTRIBUTOR = "artemist"; # Workaround for https://github.com/NixOS/nixpkgs/issues/166205 - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; - }; + env = lib.optionalAttrs stdenv.cc.isClang { NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; }; # Recursive Nix is not stable yet doCheck = false; - postInstall = - lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - if [[ -f $out/bin/attic ]]; then - installShellCompletion --cmd attic \ - --bash <($out/bin/attic gen-completions bash) \ - --zsh <($out/bin/attic gen-completions zsh) \ - --fish <($out/bin/attic gen-completions fish) - fi - ''; + postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + if [[ -f $out/bin/attic ]]; then + installShellCompletion --cmd attic \ + --bash <($out/bin/attic gen-completions bash) \ + --zsh <($out/bin/attic gen-completions zsh) \ + --fish <($out/bin/attic gen-completions fish) + fi + ''; meta = with lib; { description = "Multi-tenant Nix binary cache system"; diff --git a/packages/axidraw/inkscape.nix b/packages/axidraw/inkscape.nix index 6252bd7..fa12ab9 100644 --- a/packages/axidraw/inkscape.nix +++ b/packages/axidraw/inkscape.nix @@ -1,12 +1,16 @@ -{ stdenv, lib, fetchzip, autoPatchelfHook }: +{ + stdenv, + lib, + fetchzip, + autoPatchelfHook, +}: stdenv.mkDerivation rec { pname = "axidraw-inkscape"; version = "394"; src = fetchzip { - url = - "https://cdn.evilmadscientist.com/dl/ad/public/${version}/AxiDraw_${version}_LinX86.zip"; + url = "https://cdn.evilmadscientist.com/dl/ad/public/${version}/AxiDraw_${version}_LinX86.zip"; hash = "sha256-LoNi7mR30spELnEYikRuYFvlgUWP3w8KRbQ6Ug108vU="; }; @@ -23,8 +27,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Inkscape extension for managing axidraw"; - homepage = - "https://wiki.evilmadscientist.com/Axidraw_Software_Installation"; + homepage = "https://wiki.evilmadscientist.com/Axidraw_Software_Installation"; license = licenses.gpl2Plus; maintainers = with maintainers; [ artemist ]; platforms = [ "x86_64-linux" ]; diff --git a/packages/axidraw/modules.nix b/packages/axidraw/modules.nix index 17e88ef..7760241 100644 --- a/packages/axidraw/modules.nix +++ b/packages/axidraw/modules.nix @@ -1,22 +1,26 @@ -{ python3, fetchPypi, fetchzip, fetchurl }: +{ + python3, + fetchPypi, + fetchzip, + fetchurl, +}: let inherit (python3) buildPythonPackage; axicliVersion = "3.9.0"; axicliVer = builtins.replaceStrings [ "." ] [ "" ] axicliVersion; axicliSrc = fetchzip { - url = - "https://github.com/evil-mad/axidraw/releases/download/v${axicliVersion}/AxiDraw_API_${axicliVer}.zip"; + url = "https://github.com/evil-mad/axidraw/releases/download/v${axicliVersion}/AxiDraw_API_${axicliVer}.zip"; hash = "sha256-RPh00jiiH1RqqKZ10ylFP1J+iBYl5VOmZ8g0vFH8Ibg="; }; -in { +in +{ drawsvg = buildPythonPackage { pname = "drawsvg"; version = "2.3.0"; format = "wheel"; src = fetchurl { - url = - "https://files.pythonhosted.org/packages/27/4f/65d72a014026495d8d2847e66bbe542cf899e50f087a50e0abab9c58ef3c/drawsvg-2.3.0-py3-none-any.whl"; + url = "https://files.pythonhosted.org/packages/27/4f/65d72a014026495d8d2847e66bbe542cf899e50f087a50e0abab9c58ef3c/drawsvg-2.3.0-py3-none-any.whl"; sha256 = "1gqa5q5b7y38isyw1kgq2lprw5709jv13pic9s6bk80dbm32pbck"; }; }; @@ -39,15 +43,17 @@ in { hash = "sha256-YxSASXBNXqRyGp7x6jlTU0UYJHJkiKdlEzfDMzUtKXk="; }; doCheck = false; - propagatedBuildInputs = with python3; [ ink-extensions pyserial ]; + propagatedBuildInputs = with python3; [ + ink-extensions + pyserial + ]; }; axidrawinternal = buildPythonPackage { pname = "axidrawinternal"; version = axicliVersion; format = "wheel"; - src = - "${axicliSrc}/prebuilt_dependencies/axidrawinternal-${axicliVersion}-py2.py3-none-any.whl"; + src = "${axicliSrc}/prebuilt_dependencies/axidrawinternal-${axicliVersion}-py2.py3-none-any.whl"; propagatedBuildInputs = with python3; [ ink-extensions requests diff --git a/packages/cups-dymo/default.nix b/packages/cups-dymo/default.nix index 6b32cda..2d4ac84 100644 --- a/packages/cups-dymo/default.nix +++ b/packages/cups-dymo/default.nix @@ -1,4 +1,13 @@ -{ stdenv, lib, fetchFromGitHub, autoconf, automake, boost, cups, ... }: +{ + stdenv, + lib, + fetchFromGitHub, + autoconf, + automake, + boost, + cups, + ... +}: stdenv.mkDerivation { pname = "cups-dymo"; @@ -11,9 +20,15 @@ stdenv.mkDerivation { hash = "sha256-IwdTJxCOKyqsl1B5UQqCDpepz04U4VF+G3mqaJTQJ/w="; }; - nativeBuildInputs = [ autoconf automake ]; + nativeBuildInputs = [ + autoconf + automake + ]; - buildInputs = [ boost cups ]; + buildInputs = [ + boost + cups + ]; preConfigure = '' touch NEWS AUTHORS INSTALL README ChangeLog diff --git a/packages/hactoolnet/default.nix b/packages/hactoolnet/default.nix index f6d4cdd..fc08b57 100644 --- a/packages/hactoolnet/default.nix +++ b/packages/hactoolnet/default.nix @@ -1,4 +1,9 @@ -{ lib, buildDotnetModule, dotnetCorePackages, fetchFromGitHub }: +{ + lib, + buildDotnetModule, + dotnetCorePackages, + fetchFromGitHub, +}: buildDotnetModule rec { pname = "hactoolnet"; @@ -22,8 +27,7 @@ buildDotnetModule rec { meta = with lib; { homepage = "https://github.com/Thealexbarney/LibHac"; - description = - "Example program for LibHac, which implements parts of Horizon OS"; + description = "Example program for LibHac, which implements parts of Horizon OS"; license = licenses.mit; platforms = platforms.unix; }; diff --git a/packages/hactoolnet/deps.nix b/packages/hactoolnet/deps.nix index c69509c..a12df67 100644 --- a/packages/hactoolnet/deps.nix +++ b/packages/hactoolnet/deps.nix @@ -1,7 +1,8 @@ # This file was automatically generated by passthru.fetch-deps. # Please dont edit it manually, your changes might get overwritten! -{ fetchNuGet }: [ +{ fetchNuGet }: +[ (fetchNuGet { pname = "Microsoft.AspNetCore.App.Ref"; version = "7.0.16"; diff --git a/packages/ipsw/default.nix b/packages/ipsw/default.nix index e4ab8dc..c771620 100644 --- a/packages/ipsw/default.nix +++ b/packages/ipsw/default.nix @@ -1,4 +1,11 @@ -{ lib, buildGo122Module, fetchFromGitHub, unicorn, libusb, pkg-config }: +{ + lib, + buildGo122Module, + fetchFromGitHub, + unicorn, + libusb, + pkg-config, +}: buildGo122Module rec { pname = "ipsw"; @@ -15,14 +22,20 @@ buildGo122Module rec { patches = [ ./fix-build.patch ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ unicorn libusb ]; + buildInputs = [ + unicorn + libusb + ]; ldflags = [ "-s" "-w" "-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppVersion=${version}" "-X github.com/blacktop/ipsw/cmd/ipsw/cmd.AppBuildTime=19700101" ]; - tags = [ "unicorn" "libusb" ]; + tags = [ + "unicorn" + "libusb" + ]; doCheck = false; meta = with lib; { diff --git a/packages/jlink/default.nix b/packages/jlink/default.nix index 8022624..d21152c 100644 --- a/packages/jlink/default.nix +++ b/packages/jlink/default.nix @@ -1,10 +1,29 @@ -{ stdenv, lib, fetchurl, autoPatchelfHook, fontconfig, freetype, libgcc, libusb -, libICE, libSM, ncurses5, udev, libX11, libXext, libXcursor, libXfixes -, libXrender, libXrandr }: +{ + stdenv, + lib, + fetchurl, + autoPatchelfHook, + fontconfig, + freetype, + libgcc, + libusb, + libICE, + libSM, + ncurses5, + udev, + libX11, + libXext, + libXcursor, + libXfixes, + libXrender, + libXrandr, +}: let - conf = (lib.importJSON ./version.json).${stdenv.hostPlatform.system} or (throw - "unsupported system ${stdenv.hostPlatform.system}"); -in stdenv.mkDerivation rec { + conf = + (lib.importJSON ./version.json).${stdenv.hostPlatform.system} + or (throw "unsupported system ${stdenv.hostPlatform.system}"); +in +stdenv.mkDerivation rec { pname = "jlink"; version = conf.version; @@ -52,7 +71,12 @@ in stdenv.mkDerivation rec { homepage = "https://www.segger.com/downloads/jlink"; description = "SEGGER J-Link"; 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 ]; }; } diff --git a/packages/kernelPatches/default.nix b/packages/kernelPatches/default.nix index e9ad64f..6831cef 100644 --- a/packages/kernelPatches/default.nix +++ b/packages/kernelPatches/default.nix @@ -1,4 +1,5 @@ -{ ... }: { +{ ... }: +{ increase_max_topo = { name = "increase-max-topo"; patch = ./increase-max-topo.patch; diff --git a/packages/pnoise/default.nix b/packages/pnoise/default.nix index b3ca3dd..fa533d3 100644 --- a/packages/pnoise/default.nix +++ b/packages/pnoise/default.nix @@ -1,4 +1,8 @@ -{ lib, python3, fetchFromGitHub }: +{ + lib, + python3, + fetchFromGitHub, +}: python3.buildPythonPackage rec { pname = "pnoise"; diff --git a/packages/stlink-tool/default.nix b/packages/stlink-tool/default.nix index 40c940d..6418a85 100644 --- a/packages/stlink-tool/default.nix +++ b/packages/stlink-tool/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchFromGitHub, pkg-config, libusb1 }: +{ + stdenv, + fetchFromGitHub, + pkg-config, + libusb1, +}: stdenv.mkDerivation rec { pname = "stlink-tool"; diff --git a/packages/vpype-gcode/default.nix b/packages/vpype-gcode/default.nix index 8d7ae4e..df9c579 100644 --- a/packages/vpype-gcode/default.nix +++ b/packages/vpype-gcode/default.nix @@ -1,4 +1,8 @@ -{ lib, python3, fetchFromGitHub }: +{ + lib, + python3, + fetchFromGitHub, +}: python3.buildPythonPackage rec { pname = "vpype"; @@ -12,7 +16,11 @@ python3.buildPythonPackage rec { hash = "sha256-waSHw4DBgozcBwNTgZwGfvmg0UHaENJIGrCqnMu0ruU="; }; - propagatedBuildInputs = with python3; [ click numpy vpype ]; + propagatedBuildInputs = with python3; [ + click + numpy + vpype + ]; meta = with lib; { description = "gcode extension for vpype"; diff --git a/packages/vpype/default.nix b/packages/vpype/default.nix index 86492ae..c953dac 100644 --- a/packages/vpype/default.nix +++ b/packages/vpype/default.nix @@ -1,4 +1,9 @@ -{ lib, python3, fetchFromGitHub, withViewer ? true }: +{ + lib, + python3, + fetchFromGitHub, + withViewer ? true, +}: python3.buildPythonPackage rec { pname = "vpype"; @@ -15,33 +20,36 @@ python3.buildPythonPackage rec { nativeBuildInputs = with python3; [ poetry-core ]; - propagatedBuildInputs = with python3; - ([ - asteval - cachetools - click - multiprocess - numpy - pnoise - pyphen - scipy - shapely - svgelements - svgwrite - tomli - ] ++ lib.optionals withViewer [ - glcontext - matplotlib - moderngl - pillow - pyside6 - ]); + propagatedBuildInputs = + with python3; + ( + [ + asteval + cachetools + click + multiprocess + numpy + pnoise + pyphen + scipy + shapely + svgelements + svgwrite + tomli + ] + ++ lib.optionals withViewer [ + glcontext + matplotlib + moderngl + pillow + pyside6 + ] + ); # No checks since they want OpenGL and a GUI meta = with lib; { - description = - "The Swiss-Army-knife command-line tool for plotter vector graphics"; + description = "The Swiss-Army-knife command-line tool for plotter vector graphics"; homepage = "https://vpype.readthedocs.io/en/latest/"; license = with licenses; [ mit ]; maintainers = with maintainers; [ artemist ]; diff --git a/packages/zephyr/default.nix b/packages/zephyr/default.nix index 3a1b32c..eda6dee 100644 --- a/packages/zephyr/default.nix +++ b/packages/zephyr/default.nix @@ -1,19 +1,27 @@ -{ callPackage, stdenv, lib, fetchFromGitHub }: +{ + callPackage, + stdenv, + lib, + fetchFromGitHub, +}: let assets = lib.importJSON ./assets.json; modules = lib.importJSON ./modules.json; buildModule = module: callPackage ./module.nix { inherit module; }; -in { +in +{ host-tools = callPackage ./host-tools.nix { inherit (assets) version hosts; sources = assets.host_tools; }; - toolchains = lib.mapAttrs (target: sources: + toolchains = lib.mapAttrs ( + target: sources: callPackage ./toolchain.nix { inherit target sources; inherit (assets) version hosts; - }) assets.toolchains; + } + ) assets.toolchains; sdk = callPackage ./sdk.nix { inherit (assets) version hosts; diff --git a/packages/zephyr/host-tools.nix b/packages/zephyr/host-tools.nix index 2e03a84..fed61ae 100644 --- a/packages/zephyr/host-tools.nix +++ b/packages/zephyr/host-tools.nix @@ -1,9 +1,21 @@ -{ stdenv, fetchurl, hosts, lib, python3, sources, version, which }: +{ + stdenv, + fetchurl, + hosts, + lib, + python3, + sources, + version, + which, +}: stdenv.mkDerivation rec { pname = "zephyr-host-tools"; inherit version; - nativeBuildInputs = [ python3 which ]; + nativeBuildInputs = [ + python3 + which + ]; src = fetchurl (sources."${stdenv.hostPlatform.system}"); dontUnpack = true; diff --git a/packages/zephyr/module.nix b/packages/zephyr/module.nix index 38499da..6afbeb6 100644 --- a/packages/zephyr/module.nix +++ b/packages/zephyr/module.nix @@ -1,14 +1,21 @@ -{ stdenvNoCC, lib, fetchFromGitHub, symlinkJoin, fetchurl, version ? null -, module }: +{ + stdenvNoCC, + lib, + fetchFromGitHub, + symlinkJoin, + fetchurl, + version ? null, + module, +}: let - labeledName = label: - if version != null then - "${module.name}-${label}-${version}" - else - "${module.name}-${label}"; - fetchBlob = blob: - let blobFile = fetchurl { inherit (blob) url sha256; }; - in stdenvNoCC.mkDerivation { + labeledName = + label: if version != null then "${module.name}-${label}-${version}" else "${module.name}-${label}"; + fetchBlob = + blob: + let + blobFile = fetchurl { inherit (blob) url sha256; }; + in + stdenvNoCC.mkDerivation { name = "blob-${blob.path}"; passAsFile = [ "buildCommand" ]; buildCommand = '' @@ -16,12 +23,21 @@ let 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 { name = labeledName "with-blobs"; paths = [ baseSrc ] ++ (map fetchBlob module.blobs); }; -in stdenvNoCC.mkDerivation (finalAttrs: { +in +stdenvNoCC.mkDerivation (finalAttrs: { name = labeledName "wrapped"; passthru.modulePath = "${finalAttrs.finalPackage.out}/${module.name}"; @@ -32,4 +48,3 @@ in stdenvNoCC.mkDerivation (finalAttrs: { ln -s ${blobbedSrc} "$out/${module.name}" ''; }) - diff --git a/packages/zephyr/sdk.nix b/packages/zephyr/sdk.nix index be25c1b..d968e73 100644 --- a/packages/zephyr/sdk.nix +++ b/packages/zephyr/sdk.nix @@ -1,7 +1,17 @@ -{ lib, symlinkJoin, fetchurl, zephyrPackages, source, version, hosts -, toolchains ? [ ] }: -let src = fetchurl source; -in symlinkJoin rec { +{ + lib, + symlinkJoin, + fetchurl, + zephyrPackages, + source, + version, + hosts, + toolchains ? [ ], +}: +let + src = fetchurl source; +in +symlinkJoin rec { pname = "zephyr-sdk"; inherit version; name = "${pname}-${version}"; diff --git a/packages/zephyr/toolchain.nix b/packages/zephyr/toolchain.nix index fdf373a..fcb5558 100644 --- a/packages/zephyr/toolchain.nix +++ b/packages/zephyr/toolchain.nix @@ -1,4 +1,13 @@ -{ stdenv, lib, fetchurl, autoPatchelfHook, target, sources, version, hosts }: +{ + stdenv, + lib, + fetchurl, + autoPatchelfHook, + target, + sources, + version, + hosts, +}: stdenv.mkDerivation { pname = "zephyr-toolchain-${target}"; @@ -35,8 +44,7 @@ stdenv.mkDerivation { meta = with lib; { homepage = "https://www.zephyrproject.org/"; - description = - "Toolchain for building Zephyr for the ${target} architecture"; + description = "Toolchain for building Zephyr for the ${target} architecture"; license = licenses.asl20; platforms = hosts; maintainers = with maintainers; [ artemist ]; diff --git a/shells/plotter/default.nix b/shells/plotter/default.nix index 479b07f..201589c 100644 --- a/shells/plotter/default.nix +++ b/shells/plotter/default.nix @@ -1,24 +1,31 @@ -{ lib, mkShell, python3, inkscape-with-extensions, inkscape-extensions, jupyter +{ + lib, + mkShell, + python3, + inkscape-with-extensions, + inkscape-extensions, + jupyter, }: mkShell { - packages = [ - (inkscape-with-extensions.override { - inkscapeExtensions = with inkscape-extensions; [ - silhouette - inkcut - axidraw - ]; - }) - python3 - jupyter - ] ++ (with python3.pkgs; [ - axicli - drawsvg - ipython - pillow - requests - vpype - vpype-gcode - ]); - + packages = + [ + (inkscape-with-extensions.override { + inkscapeExtensions = with inkscape-extensions; [ + silhouette + inkcut + axidraw + ]; + }) + python3 + jupyter + ] + ++ (with python3.pkgs; [ + axicli + drawsvg + ipython + pillow + requests + vpype + vpype-gcode + ]); } diff --git a/shells/ryujinx/default.nix b/shells/ryujinx/default.nix index a632362..3ba6671 100644 --- a/shells/ryujinx/default.nix +++ b/shells/ryujinx/default.nix @@ -1,6 +1,28 @@ -{ lib, mkShell, dotnetCorePackages, libX11, libgdiplus, SDL2_mixer, openal -, libsoundio, sndio, pulseaudio, vulkan-loader, ffmpeg, libICE, libSM, libXi -, libXcursor, libXext, libXrandr, fontconfig, glew, libGL, SDL2, udev }: +{ + lib, + 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 { packages = [ diff --git a/shells/zephyr/default.nix b/shells/zephyr/default.nix index 4106220..c1f50f6 100644 --- a/shells/zephyr/default.nix +++ b/shells/zephyr/default.nix @@ -1,34 +1,62 @@ -{ lib, mkShell, zephyrPackages, cmake, ninja, 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 - pyelftools - pyyaml - pykwalify - canopen - packaging - progress - psutil - pylink-square - pyserial - requests - anytree - intelhex - ] ++ lib.optional enableWest python3.pkgs.west ++ extraPackages); +{ + lib, + mkShell, + zephyrPackages, + cmake, + ninja, + 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 + pyelftools + pyyaml + pykwalify + canopen + packaging + progress + psutil + pylink-square + pyserial + requests + anytree + intelhex + ] + ++ lib.optional enableWest python3.pkgs.west + ++ extraPackages + ); - ZEPHYR_TOOLCHAIN_VARIANT = "zephyr"; - ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}"; -} // lib.optionalAttrs (zephyrSrc != null) { - ZEPHYR_BASE = "${zephyrSrc}"; - shellHook = '' - PATH="${zephyrSrc}/scripts:$PATH" - ''; -} // lib.optionalAttrs (modules != [ ]) { - ZEPHYR_MODULES = - lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules); -} // extraAttrs) + ZEPHYR_TOOLCHAIN_VARIANT = "zephyr"; + ZEPHYR_SDK_INSTALL_DIR = "${zephyr-sdk}"; + } + // lib.optionalAttrs (zephyrSrc != null) { + ZEPHYR_BASE = "${zephyrSrc}"; + shellHook = '' + PATH="${zephyrSrc}/scripts:$PATH" + ''; + } + // lib.optionalAttrs (modules != [ ]) { + ZEPHYR_MODULES = lib.concatStringsSep ";" (map (pkg: pkg.passthru.modulePath) modules); + } + // extraAttrs +)