Skip to content

Commit

Permalink
feat: add basic nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanperias committed Jan 2, 2025
1 parent d4df286 commit 5efaab4
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 0 deletions.
130 changes: 130 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
description = "Pixels flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

crane.url = "github:ipetkov/crane";

flake-utils.url = "github:numtide/flake-utils";

fenix.url = "github:nix-community/fenix";
};

outputs = { nixpkgs, flake-utils, fenix, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};

crane = inputs.crane.mkLib pkgs;
toolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-s1RPtyvDGJaX/BisLT+ifVfuhDT1nZkZ1NcK8sbwELM=";
};

craneLib = crane.overrideToolchain toolchain;
in
{
devShells.default = craneLib.devShell {
packages = [
toolchain
];
};
});
}

3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "stable"
targets = ["wasm32-unknown-unknown", "aarch64-linux-android"]

0 comments on commit 5efaab4

Please sign in to comment.