From c0eb488973372818dedcc76e8db07fc73e491d07 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Tue, 10 Dec 2024 19:02:25 +0100 Subject: [PATCH] format flake, add gcc (#57) --- flake.nix | 98 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/flake.nix b/flake.nix index ee8a048..ae00aae 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,14 @@ }; }; - outputs = { self, fenix, nixpkgs, tsunami, ... }: + outputs = + { + self, + fenix, + nixpkgs, + tsunami, + ... + }: let allSystems = [ "x86_64-linux" # 64-bit Intel/AMD Linux @@ -17,24 +24,33 @@ "x86_64-darwin" # 64-bit Intel macOS "aarch64-darwin" # 64-bit ARM macOS ]; - forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { - inherit system; - inherit tsunami; - pkgs = import nixpkgs { inherit system; }; - fpkgs = import fenix { inherit system; }; - }); + forAllSystems = + f: + nixpkgs.lib.genAttrs allSystems ( + system: + f { + inherit system; + inherit tsunami; + pkgs = import nixpkgs { inherit system; }; + fpkgs = import fenix { inherit system; }; + } + ); in { - packages = forAllSystems - ({ pkgs, fpkgs, ... }: - let - toolchain = fpkgs.minimal.toolchain; - fs = pkgs.lib.fileset; - in - rec { - default = flurry; - flurry = - (pkgs.makeRustPlatform { cargo = toolchain; rustc = toolchain; }).buildRustPackage { + packages = forAllSystems ( + { pkgs, fpkgs, ... }: + let + toolchain = fpkgs.minimal.toolchain; + fs = pkgs.lib.fileset; + in + rec { + default = flurry; + flurry = + (pkgs.makeRustPlatform { + cargo = toolchain; + rustc = toolchain; + }).buildRustPackage + { pname = "flurry"; version = "0.1.0"; cargoLock.lockFile = ./Cargo.lock; @@ -47,30 +63,36 @@ ]; }; }; - }); - devShells = forAllSystems - ({ pkgs, fpkgs, system, ... }: - let - ffpkgs = fpkgs.complete; - in - { - default = pkgs.mkShell - { - buildInputs = [ - ffpkgs.cargo - ffpkgs.clippy - ffpkgs.rust-src - ffpkgs.rustc - ffpkgs.rustfmt - pkgs.wgo - tsunami.packages.${system}.tsunami - ]; - }; - }); + } + ); + devShells = forAllSystems ( + { + pkgs, + fpkgs, + system, + ... + }: + let + ffpkgs = fpkgs.complete; + in + { + default = pkgs.mkShell { + buildInputs = [ + ffpkgs.cargo + ffpkgs.clippy + ffpkgs.rust-src + ffpkgs.rustc + ffpkgs.rustfmt + pkgs.gcc + pkgs.wgo + tsunami.packages.${system}.tsunami + ]; + }; + } + ); hydraJobs = { devShell.x86_64-linux = self.devShells.x86_64-linux.default; flurry.x86_64-linux = self.packages.x86_64-linux.flurry; }; }; } -