57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{
|
|
description = "ISO7010 Twitter bot";
|
|
|
|
inputs = {
|
|
utils.url = "github:numtide/flake-utils";
|
|
devshell.url = "github:numtide/devshell";
|
|
naersk.url = "github:nix-community/naersk";
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
utils,
|
|
naersk,
|
|
devshell,
|
|
rust-overlay,
|
|
}:
|
|
utils.lib.eachDefaultSystem (system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [(import rust-overlay)];
|
|
};
|
|
rust = pkgs.rust-bin.stable.latest.default.override {
|
|
extensions = [ "rust-src" ];
|
|
};
|
|
# Override naersk to use our chosen rust version from rust-overlay
|
|
naersk-lib = naersk.lib.${system}.override {
|
|
cargo = rust;
|
|
rustc = rust;
|
|
};
|
|
packig = naersk-lib.buildPackage {
|
|
pname = "iso7010-a-day";
|
|
root = ./.;
|
|
buildInputs = [pkgs.openssl pkgs.pkgconfig];
|
|
};
|
|
in {
|
|
packages.default = packig;
|
|
|
|
apps.default = utils.lib.mkApp {drv = packig;};
|
|
|
|
hydraJobs.build = packig;
|
|
|
|
# Provide a dev env with rust and rls
|
|
devShells.default = let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [devshell.overlays.default];
|
|
};
|
|
in
|
|
pkgs.devshell.mkShell {
|
|
packages = with pkgs; [rust rust-analyzer];
|
|
};
|
|
formatter = pkgs.alejandra;
|
|
});
|
|
}
|