flake: switch to nixfmt-rfc-style

This commit is contained in:
Artemis Tosini 2024-07-07 21:13:56 +00:00
parent 489dcfacd7
commit 8a129be532
Signed by: artemist
GPG key ID: EE5227935FE3FF18
3 changed files with 110 additions and 81 deletions

View file

@ -13,8 +13,16 @@
inputs.flake-utils.follows = "utils"; inputs.flake-utils.follows = "utils";
}; };
}; };
outputs = { self, nixpkgs, utils, artemist-packages, rust-overlay }: outputs =
utils.lib.eachDefaultSystem (system: {
self,
nixpkgs,
utils,
artemist-packages,
rust-overlay,
}:
utils.lib.eachDefaultSystem (
system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
@ -23,9 +31,9 @@
rust-overlay.overlays.default rust-overlay.overlays.default
]; ];
}; };
in rec { in
devShells.zephyr = rec {
artemist-packages.devShells.${system}.zephyr.override { devShells.zephyr = artemist-packages.devShells.${system}.zephyr.override {
toolchains = with pkgs.zephyrPackages.toolchains; [ toolchains = with pkgs.zephyrPackages.toolchains; [
arm-zephyr-eabi arm-zephyr-eabi
riscv64-zephyr-elf riscv64-zephyr-elf
@ -43,9 +51,14 @@
zephyrSrc = null; zephyrSrc = null;
modules = [ ]; modules = [ ];
}; };
devShells.rust-embedded = let devShells.rust-embedded =
let
rust = pkgs.rust-bin.stable.latest.default.override { rust = pkgs.rust-bin.stable.latest.default.override {
extensions = [ "rust-src" "llvm-tools-preview" "clippy" ]; extensions = [
"rust-src"
"llvm-tools-preview"
"clippy"
];
# just use all of them, why not # just use all of them, why not
targets = [ targets = [
"thumbv6m-none-eabi" "thumbv6m-none-eabi"
@ -66,7 +79,8 @@
}; };
cargoHash = "sha256-dhPp93AH4VlOVJWXMMUwv8b53vLPdBY3WyaXE4kcEm4="; cargoHash = "sha256-dhPp93AH4VlOVJWXMMUwv8b53vLPdBY3WyaXE4kcEm4=";
}; };
in with pkgs; in
with pkgs;
mkShell { mkShell {
packages = [ packages = [
cargo-binutils cargo-binutils
@ -82,18 +96,29 @@
]; ];
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
}; };
devShells.rust = with pkgs; devShells.rust =
with pkgs;
mkShell { mkShell {
nativeBuildInputs = [ rustc cargo rustfmt clippy ]; nativeBuildInputs = [
rustc
cargo
rustfmt
clippy
];
RUST_SRC_PATH = "${rust.packages.stable.rustPlatform.rustLibSrc}"; RUST_SRC_PATH = "${rust.packages.stable.rustPlatform.rustLibSrc}";
}; };
devShells.avr = with pkgs; devShells.avr =
with pkgs;
pkgsCross.avr.mkShell { pkgsCross.avr.mkShell {
packages = [ avrdude gnumake ]; packages = [
avrdude
gnumake
];
LIBC = pkgsCross.avr.avrlibc; LIBC = pkgsCross.avr.avrlibc;
}; };
devShells.emoji = with pkgs; devShells.emoji =
with pkgs;
mkShell { mkShell {
packages = [ packages = [
chromedriver chromedriver
@ -105,7 +130,9 @@
python3Packages.trio python3Packages.trio
python3Packages.gql python3Packages.gql
(python3Packages.selenium.overrideAttrs (old: { (python3Packages.selenium.overrideAttrs (old: {
postInstall = old.postInstall + '' postInstall =
old.postInstall
+ ''
for ver in v85 v120 v121 v122; do for ver in v85 v120 v121 v122; do
DEVTOOLS=../common/devtools/chromium/$ver DEVTOOLS=../common/devtools/chromium/$ver
for proto in js browser; do for proto in js browser; do
@ -122,15 +149,15 @@
done done
''; '';
nativeBuildInputs = old.nativeBuildInputs nativeBuildInputs = old.nativeBuildInputs ++ [ python3Packages.inflection ];
++ [ python3Packages.inflection ];
})) }))
]; ];
CHROME = "${chromium}/bin/chromium"; CHROME = "${chromium}/bin/chromium";
}; };
devShells.typst = with pkgs; mkShell { packages = [ typst ]; }; devShells.typst = with pkgs; mkShell { packages = [ typst ]; };
formatter = pkgs.nixfmt; formatter = pkgs.nixfmt-rfc-style;
}); }
);
} }

View file

@ -12,4 +12,5 @@ let
} }
]; ];
}; };
in system.config.system.build.sdImage in
system.config.system.build.sdImage

View file

@ -7,7 +7,8 @@ let
rev = "1.4.0"; rev = "1.4.0";
sha256 = "sha256-i3IAaNcd0EfKNvU104a776O1poDAChlx1m+nP8iFn8E="; sha256 = "sha256-i3IAaNcd0EfKNvU104a776O1poDAChlx1m+nP8iFn8E=";
}; };
in mkShell rec { in
mkShell rec {
name = "pico-env"; name = "pico-env";
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];