format flake, add gcc (#57)

This commit is contained in:
Noa Aarts 2024-12-10 19:02:25 +01:00 committed by GitHub
parent 8969a9e6d5
commit c0eb488973
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,14 @@
}; };
}; };
outputs = { self, fenix, nixpkgs, tsunami, ... }: outputs =
{
self,
fenix,
nixpkgs,
tsunami,
...
}:
let let
allSystems = [ allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux "x86_64-linux" # 64-bit Intel/AMD Linux
@ -17,16 +24,21 @@
"x86_64-darwin" # 64-bit Intel macOS "x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS "aarch64-darwin" # 64-bit ARM macOS
]; ];
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f { forAllSystems =
f:
nixpkgs.lib.genAttrs allSystems (
system:
f {
inherit system; inherit system;
inherit tsunami; inherit tsunami;
pkgs = import nixpkgs { inherit system; }; pkgs = import nixpkgs { inherit system; };
fpkgs = import fenix { inherit system; }; fpkgs = import fenix { inherit system; };
}); }
);
in in
{ {
packages = forAllSystems packages = forAllSystems (
({ pkgs, fpkgs, ... }: { pkgs, fpkgs, ... }:
let let
toolchain = fpkgs.minimal.toolchain; toolchain = fpkgs.minimal.toolchain;
fs = pkgs.lib.fileset; fs = pkgs.lib.fileset;
@ -34,7 +46,11 @@
rec { rec {
default = flurry; default = flurry;
flurry = flurry =
(pkgs.makeRustPlatform { cargo = toolchain; rustc = toolchain; }).buildRustPackage { (pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
}).buildRustPackage
{
pname = "flurry"; pname = "flurry";
version = "0.1.0"; version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
@ -47,30 +63,36 @@
]; ];
}; };
}; };
}); }
devShells = forAllSystems );
({ pkgs, fpkgs, system, ... }: devShells = forAllSystems (
{
pkgs,
fpkgs,
system,
...
}:
let let
ffpkgs = fpkgs.complete; ffpkgs = fpkgs.complete;
in in
{ {
default = pkgs.mkShell default = pkgs.mkShell {
{
buildInputs = [ buildInputs = [
ffpkgs.cargo ffpkgs.cargo
ffpkgs.clippy ffpkgs.clippy
ffpkgs.rust-src ffpkgs.rust-src
ffpkgs.rustc ffpkgs.rustc
ffpkgs.rustfmt ffpkgs.rustfmt
pkgs.gcc
pkgs.wgo pkgs.wgo
tsunami.packages.${system}.tsunami tsunami.packages.${system}.tsunami
]; ];
}; };
}); }
);
hydraJobs = { hydraJobs = {
devShell.x86_64-linux = self.devShells.x86_64-linux.default; devShell.x86_64-linux = self.devShells.x86_64-linux.default;
flurry.x86_64-linux = self.packages.x86_64-linux.flurry; flurry.x86_64-linux = self.packages.x86_64-linux.flurry;
}; };
}; };
} }