feat: add nix output

This commit is contained in:
Noa Aarts 2024-10-05 10:12:28 +02:00
parent 7fa73aac6e
commit 1e04b94051
Signed by: noa
GPG key ID: 1850932741EFF672

View file

@ -1,7 +1,13 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... }:
outputs = { self, fenix, nixpkgs, ... }:
let
allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
@ -12,10 +18,26 @@
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
inherit system;
pkgs = import nixpkgs { inherit system; };
fpkgs = import fenix { inherit system; };
});
in
{
devShell = forAllSystems ({ system, pkgs }:
packages = forAllSystems
({ system, pkgs, fpkgs }:
let
toolchain = fpkgs.minimal.toolchain;
in
rec {
default = flurry;
flurry =
(pkgs.makeRustPlatform { cargo = toolchain; rustc = toolchain; }).buildRustPackage {
pname = "flurry";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
};
});
devShell = forAllSystems ({ system, pkgs, ... }:
pkgs.mkShell {
buildInputs = [
pkgs.rustup
@ -26,3 +48,4 @@
});
};
}