Created
August 29, 2024 16:53
-
-
Save jperras/f2d07f8db72664352071c3f80f93b7aa to your computer and use it in GitHub Desktop.
Simple nix flake for Rust project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs = { | |
nixpkgs.url = "github:nixos/nixpkgs"; | |
flake-utils.url = "github:numtide/flake-utils"; | |
}; | |
outputs = { self, nixpkgs, flake-utils }: | |
flake-utils.lib.eachDefaultSystem (system: | |
with nixpkgs.legacyPackages.${system}; { | |
packages.foo = rustPlatform.buildRustPackage { | |
name = "foo"; | |
version = "0.1"; | |
src = lib.cleanSource ./.; | |
cargoSha256 = | |
"<sha>"; | |
}; | |
defaultPackage = self.packages.${system}.foo; | |
devShell = mkShell { | |
inputsFrom = builtins.attrValues self.packages.${system}; | |
buildInputs = [ cargo ]; | |
nativeBuildInputs = [ cargo ]; | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment