From 1a673358a71e8b57fd3a3ee83207235bc5582752 Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Mon, 5 May 2025 21:36:33 +0200 Subject: [PATCH] nixfmt --- default.nix | 34 ++++++++++++++-------------- flake.nix | 65 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/default.nix b/default.nix index 45baa25..913b6fe 100644 --- a/default.nix +++ b/default.nix @@ -11,25 +11,25 @@ (makeRustPlatform { cargo = rust; rustc = rust; -}) -.buildRustPackage { - pname = packageToml.name; - inherit (packageToml) version; +}).buildRustPackage + { + pname = packageToml.name; + inherit (packageToml) version; - src = builtins.path { - path = ./.; - inherit (packageToml) name; - }; + src = builtins.path { + path = ./.; + inherit (packageToml) name; + }; - dontUseCargoParallelTests = true; + dontUseCargoParallelTests = true; - cargoLock.lockFile = ./Cargo.lock; + cargoLock.lockFile = ./Cargo.lock; - nativeBuildInputs = [rust]; - buildInputs = lib.optional stdenv.isDarwin [ - libiconv - darwin.apple_sdk.frameworks.Foundation - ]; + nativeBuildInputs = [ rust ]; + buildInputs = lib.optional stdenv.isDarwin [ + libiconv + darwin.apple_sdk.frameworks.Foundation + ]; - nativeCheckInputs = [python3]; -} + nativeCheckInputs = [ python3 ]; + } diff --git a/flake.nix b/flake.nix index e3a119d..a709488 100644 --- a/flake.nix +++ b/flake.nix @@ -7,36 +7,45 @@ flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = inputs @ { - flake-parts, - rust-overlay, - ... - }: - flake-parts.lib.mkFlake {inherit inputs;} { - systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; - perSystem = { - self', - pkgs, - system, - ... - }: let - packageToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package; - in { - formatter = pkgs.alejandra; + outputs = + inputs@{ + flake-parts, + rust-overlay, + ... + }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + perSystem = + { + self', + pkgs, + system, + ... + }: + let + packageToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package; + in + { + formatter = pkgs.alejandra; - _module.args = { - pkgs = import inputs.nixpkgs { - inherit system; - overlays = [(import rust-overlay)]; + _module.args = { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + }; + + devShells = pkgs.callPackages ./shell.nix { inherit pkgs packageToml self'; }; + + packages.default = pkgs.callPackage ./default.nix { + inherit packageToml; + rust = pkgs.rust-bin.stable.latest.minimal; }; }; - - devShells = pkgs.callPackages ./shell.nix {inherit pkgs packageToml self';}; - - packages.default = pkgs.callPackage ./default.nix { - inherit packageToml; - rust = pkgs.rust-bin.stable.latest.minimal; - }; - }; }; }