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
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;
};
};
}