Created
January 26, 2022 05:32
-
-
Save NobbZ/652f2d146562e275f298f30115cd4198 to your computer and use it in GitHub Desktop.
This file contains 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/nixos-21.05"; | |
naersk = { url = "github:nmattia/naersk"; inputs.nixpkgs.follows = "nixpkgs"; }; | |
oxalica = { url = "github:oxalica/rust-overlay"; }; | |
}; | |
outputs = { self, nixpkgs, naersk, oxalica, ... }@inputs: | |
let | |
system = "x86_64-linux"; | |
pkgs = import nixpkgs { | |
inherit system; | |
overlays = [ oxalica.overlay ]; | |
}; | |
callPackage = pkgs.lib.callPackageWith (pkgs // { | |
inherit naerskLib rustTooling self; | |
# inherit (rustTooling) rustc cargo rustPlatform; | |
}); | |
naerskLib = pkgs.callPackage naersk { | |
inherit (rustTooling) cargo rustc; | |
}; | |
rustTooling = let | |
rust = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default); | |
in rec { | |
inherit rust; | |
rustc = rust; | |
cargo = rust; | |
rustPlatform = pkgs.makeRustPlatform { | |
inherit rustc cargo; | |
}; | |
}; | |
in { | |
devShell.x86_64-linux = callPackage ({mkShell, rustTooling, nixpkgs-fmt, rustfmt, diesel-cli, sqlite}: | |
mkShell { | |
pname = "mony-dev-shell"; | |
version = "0.0.1"; | |
buildInputs = [ | |
(rustTooling.rust.override { extensions = [ "rustfmt-preview" "rust-src" "rls-preview" "rust-analysis" ]; }) | |
diesel-cli | |
nixpkgs-fmt | |
rustfmt | |
sqlite | |
]; | |
}) {}; | |
packages.x86_64-linux.mony = callPackage ({naerskLib, self}: | |
naerskLib.buildPackage { | |
pname = "mony"; | |
version = "0.0.1"; | |
src = self; | |
buildInputs = []; | |
}) {}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment