2021-10-24 13:36:13 +01:00
|
|
|
{
|
2022-09-01 14:07:57 +01:00
|
|
|
description = "ISO7010 Twitter bot";
|
2021-10-24 13:36:13 +01:00
|
|
|
|
|
|
|
inputs = {
|
2021-11-17 22:55:49 +00:00
|
|
|
utils.url = "github:numtide/flake-utils";
|
2022-09-01 14:07:57 +01:00
|
|
|
devshell.url = "github:numtide/devshell";
|
|
|
|
naersk.url = "github:nix-community/naersk";
|
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
2021-10-24 13:36:13 +01:00
|
|
|
};
|
|
|
|
|
2022-09-01 14:07:57 +01:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
utils,
|
|
|
|
naersk,
|
|
|
|
devshell,
|
|
|
|
rust-overlay,
|
|
|
|
}:
|
2021-11-17 22:55:49 +00:00
|
|
|
utils.lib.eachDefaultSystem (system: let
|
2022-09-01 14:07:57 +01:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [(import rust-overlay)];
|
|
|
|
};
|
|
|
|
rust = pkgs.rust-bin.stable.latest.default;
|
|
|
|
# Override naersk to use our chosen rust version from rust-overlay
|
|
|
|
naersk-lib = naersk.lib.${system}.override {
|
|
|
|
cargo = rust;
|
|
|
|
rustc = rust;
|
|
|
|
};
|
2021-11-17 22:55:49 +00:00
|
|
|
in rec {
|
2022-09-01 14:07:57 +01:00
|
|
|
packages.default = naersk-lib.buildPackage {
|
|
|
|
pname = "iso7010-a-day";
|
2021-11-17 22:55:49 +00:00
|
|
|
root = ./.;
|
2022-09-01 14:07:57 +01:00
|
|
|
buildInputs = [pkgs.openssl pkgs.pkgconfig];
|
2021-10-24 13:36:13 +01:00
|
|
|
};
|
2022-09-01 14:07:57 +01:00
|
|
|
|
|
|
|
apps.default = utils.lib.mkApp {drv = packages.default;};
|
|
|
|
|
|
|
|
hydraJobs.build = packages.default;
|
|
|
|
|
|
|
|
# Provide a dev env with rust and rls
|
|
|
|
devShells.default = let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [devshell.overlay];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.devshell.mkShell {
|
2022-09-13 16:44:00 +01:00
|
|
|
packages = with pkgs; [rust rust-analyzer];
|
2022-09-01 14:07:57 +01:00
|
|
|
};
|
|
|
|
formatter = pkgs.alejandra;
|
2021-11-17 22:55:49 +00:00
|
|
|
});
|
|
|
|
}
|