init
This commit is contained in:
36
flake.nix
Normal file
36
flake.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||
fenix = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/fenix";
|
||||
};
|
||||
naersk = {
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
url = "github:nix-community/naersk";
|
||||
};
|
||||
};
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
naersk,
|
||||
fenix,
|
||||
...
|
||||
}: let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
toolchain = fenix.packages.x86_64-linux.minimal.toolchain;
|
||||
in {
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
buildInputs = [toolchain];
|
||||
shellHook = ''
|
||||
export RUSTUP_TOOLCHAIN=${toolchain}
|
||||
'';
|
||||
};
|
||||
packages.x86_64-linux.default =
|
||||
(naersk.lib.x86_64-linux.override {
|
||||
cargo = toolchain;
|
||||
rustc = toolchain;
|
||||
}).buildPackage {
|
||||
src = ./.;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user