Skip to content

Commit

Permalink
Simplify flake
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-zahner committed Nov 24, 2024
1 parent 806132f commit 3faf608
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 75 deletions.
21 changes: 0 additions & 21 deletions flake.lock

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

89 changes: 35 additions & 54 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,66 +1,47 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];

perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
_module.args.pkgs = import self.inputs.nixpkgs {
inherit system;
overlays = [
(import inputs.rust-overlay)
{
nixpkgs,
rust-overlay,
...
}:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
in
{
devShells.${system}.default =
let
rustVersion = "latest"; # using a specific version: "1.62.0"
rust = pkgs.rust-bin.stable.${rustVersion}.default.override {
extensions = [
"rust-src" # for rust-analyzer
"rust-analyzer" # usable by IDEs like zed-editor
"clippy"
];
};
devShells.default =
let
rustVersion = "latest"; # using a specific version: "1.62.0"
rust = pkgs.rust-bin.stable.${rustVersion}.default.override {
extensions = [
"rust-src" # for rust-analyzer
"rust-analyzer" # usable by IDEs like zed-editor
"clippy"
];
};
libPath =
with pkgs;
lib.makeLibraryPath [
pkg-config
openssl
];

in
pkgs.mkShell {
inputsFrom = builtins.attrValues self'.packages;
packages = [
pkgs.pkg-config
pkgs.openssl
rust
];
LD_LIBRARY_PATH = libPath;
RUST_BACKTRACE = 1;
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
};
libPath = pkgs.lib.makeLibraryPath [
pkgs.pkg-config
pkgs.openssl
];
in
pkgs.mkShell {
packages = [
pkgs.pkg-config
pkgs.openssl
rust
];
LD_LIBRARY_PATH = libPath;
RUST_BACKTRACE = 1;
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
};
};
}

0 comments on commit 3faf608

Please sign in to comment.