Skip to content

Commit

Permalink
Use flake
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-zahner committed Nov 23, 2024
2 parents 3fb54ba + 1b15931 commit 88009df
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use nix
use flake
83 changes: 83 additions & 0 deletions flake.lock

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

62 changes: 62 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
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)
];
};
devShells.default =
let
libPath =
with pkgs;
lib.makeLibraryPath [
pkg-config
openssl
];
in
pkgs.mkShell {
inputsFrom = builtins.attrValues self'.packages;
packages = with pkgs; [
# (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
pkg-config
openssl
cargo
cargo-watch
rustc
rust-analyzer
clippy
];
LD_LIBRARY_PATH = libPath;
RUST_BACKTRACE = 1;
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
};
};
};
}
24 changes: 0 additions & 24 deletions shell.nix

This file was deleted.

0 comments on commit 88009df

Please sign in to comment.