diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 52 |
1 files changed, 36 insertions, 16 deletions
@@ -3,22 +3,42 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; + flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = { self, nixpkgs, flake-utils, ... }@inputs: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - config = { }; - overlays = [ ]; - }; - in { - # nix develop - devShells.default = pkgs.mkShell { - nativeBuildInputs = with pkgs; [ rustc cargo rustfmt clippy cargo-audit cargo-edit rust-analyzer ]; - }; - } - ); + outputs = + inputs@{ + self, + nixpkgs, + flake-parts, + ... + }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + perSystem = + { pkgs, system, ... }: + { + # nix develop + devShells.default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + rustc + cargo + rustfmt + clippy + cargo-audit + cargo-edit + rust-analyzer + ]; + }; + + # nix fmt + formatter = pkgs.nixfmt-tree; + }; + }; } |