Skip to content

Commit

Permalink
chore(devenv): update flake setup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjabs committed Feb 7, 2025
1 parent 1828eef commit 80f41b7
Show file tree
Hide file tree
Showing 4 changed files with 314 additions and 39 deletions.
272 changes: 270 additions & 2 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 40 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,55 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
systems.url = "github:nix-systems/default-linux";

rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";

nix-tools.url = "github:gleachkr/nix-tools";
nix-tools.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = {
outputs = inputs @ {
self,
nixpkgs,
systems,
rust-overlay,
nix-tools,
}: let
forAllSystems = nixpkgs.lib.genAttrs (import systems);
pkgsFor = nixpkgs.legacyPackages;
lib = nixpkgs.lib;
pkgsFor = lib.genAttrs (import systems) (system: (import nixpkgs {
inherit system;
overlays = [(import rust-overlay) nix-tools.overlays.default];
}));
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
in {
devShells = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./shell.nix {};
devShells = forEachSystem (pkgs: {
default = let
libs = with pkgs; [openssl xz bzip2];
in
pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
llvmPackages_12.bintools
pkg-config
clang
cmake
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
cargo-rdme
cargo-nextest
release-plz
jq
maturin
kani
];
buildInputs = libs;
LIBCLANG_PATH = lib.makeLibraryPath [pkgs.llvmPackages_12.libclang.lib];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig/";
};
});

packages = forAllSystems (system: {
tools = pkgsFor.${system}.callPackage ./tools {};
packages = forEachSystem (pkgs: {
tools = pkgs.callPackage ./tools {};
});
};
}
28 changes: 0 additions & 28 deletions shell.nix

This file was deleted.

Loading

0 comments on commit 80f41b7

Please sign in to comment.