jikan-rs/flake.nix
Dmitriy Kholkin 87fbcd53b1
initial commit
code structure like in speedrun-api and gitlab-api
2025-01-09 16:59:43 +03:00

60 lines
1.7 KiB
Nix

{
description = "devenv for jikan-rs lib";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
devenv.url = "github:cachix/devenv";
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.devenv.flakeModule ];
systems = [ "x86_64-linux" ];
perSystem = { config, self', inputs', pkgs, system, lib, ... }:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.fenix.overlays.default ];
};
devenv.shells.default = let
libs = with pkgs; [ openssl ];
toolchain = (pkgs.fenix.complete.withComponents [
"cargo"
"clippy"
"rust-docs"
"rust-src"
"rustc"
"rustfmt"
]);
in {
name = "jikan-rs-devenv";
env = {
LD_LIBRARY_PATH = lib.makeLibraryPath libs;
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
};
packages = with pkgs; libs ++ [
nixfmt-rfc-style
rust-analyzer-nightly
toolchain
];
languages.rust = {
enable = true;
channel = "nightly";
components = [];
toolchain = lib.mkForce toolchain;
};
};
};
};
}