2022-04-15 23:27:29 -04:00
|
|
|
{
|
|
|
|
description = "Better web UI for COVID wastewater data";
|
|
|
|
|
|
|
|
inputs = {
|
2022-04-17 15:03:54 -04:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2022-04-15 23:27:29 -04:00
|
|
|
utils.url = "github:numtide/flake-utils";
|
2022-12-09 16:10:22 -05:00
|
|
|
fenix.url = "github:nix-community/fenix";
|
2022-04-15 23:27:29 -04:00
|
|
|
};
|
|
|
|
|
2022-12-09 16:10:22 -05:00
|
|
|
outputs = { self, nixpkgs, utils, fenix }: let
|
2022-04-15 23:27:29 -04:00
|
|
|
name = "poop-graph";
|
|
|
|
in
|
|
|
|
utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
2022-12-09 16:10:22 -05:00
|
|
|
overlays = [ fenix.overlays.default ];
|
|
|
|
};
|
|
|
|
fenixStable = fenix.packages.${system}.stable;
|
|
|
|
fenixPlatform = pkgs.makeRustPlatform {
|
|
|
|
cargo = fenixStable.toolchain;
|
|
|
|
rustc = fenixStable.toolchain;
|
2022-04-15 23:27:29 -04:00
|
|
|
};
|
|
|
|
in rec {
|
2022-04-16 01:57:34 -04:00
|
|
|
packages.${name} = pkgs.symlinkJoin {
|
|
|
|
inherit name;
|
|
|
|
paths = [ packages."${name}-unwrapped" ];
|
|
|
|
buildInputs = [ pkgs.makeWrapper ];
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/${name} \
|
|
|
|
--set STATIC_DIR ${./static}
|
|
|
|
'';
|
|
|
|
};
|
2022-04-15 23:27:29 -04:00
|
|
|
|
|
|
|
defaultPackage = packages.${name};
|
|
|
|
|
2022-12-09 16:10:22 -05:00
|
|
|
packages."${name}-unwrapped" = let
|
|
|
|
cargoTOML = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
|
|
|
in fenixPlatform.buildRustPackage {
|
|
|
|
pname = name;
|
|
|
|
inherit (cargoTOML.package) version;
|
|
|
|
src = ./.;
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
|
|
};
|
2022-04-16 01:57:34 -04:00
|
|
|
|
2022-12-09 16:10:22 -05:00
|
|
|
devShell = with pkgs; let
|
|
|
|
fenixWith = fenixStable.withComponents [
|
|
|
|
"cargo"
|
|
|
|
"clippy"
|
|
|
|
"rust-src"
|
|
|
|
"rustc"
|
|
|
|
"rustfmt"
|
|
|
|
];
|
|
|
|
in mkShell {
|
|
|
|
nativeBuildInputs = [ fenixWith cargo-audit stdenv.cc ];
|
2022-04-15 23:27:29 -04:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|