nix flake
This commit is contained in:
parent
b63e8865e3
commit
69e44b9cbe
2 changed files with 160 additions and 0 deletions
49
flake.nix
Normal file
49
flake.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
description = "Better web UI for COVID wastewater data";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/66c99f5c6037655e4388091728d9c6b0735d5f8e";
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
crate2nix = {
|
||||
url = "github:kolloch/crate2nix";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, rust-overlay, crate2nix }: let
|
||||
name = "poop-graph";
|
||||
in
|
||||
utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
rust-overlay.overlay
|
||||
(final: prev: {
|
||||
rustc = final.rust-bin.stable.latest.default;
|
||||
cargo = final.rust-bin.stable.latest.default;
|
||||
})
|
||||
];
|
||||
};
|
||||
inherit (import "${crate2nix}/tools.nix" { inherit pkgs; })
|
||||
generatedCargoNix;
|
||||
project = import
|
||||
(generatedCargoNix {
|
||||
inherit name;
|
||||
src = ./.;
|
||||
})
|
||||
{ inherit pkgs; };
|
||||
in rec {
|
||||
packages.${name} = project.rootCrate.build;
|
||||
|
||||
defaultPackage = packages.${name};
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [ rustc cargo cargo-audit stdenv.cc ];
|
||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue