build: added shell.nix and direnv integration

This commit is contained in:
Nikita Podvirnyi 2024-05-25 12:21:32 +02:00
parent 68a68a291a
commit 222eb72da9
No known key found for this signature in database
GPG key ID: 859D416E5142AFF3
3 changed files with 42 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/target
/.direnv
flamegraph.svg
perf.data*

40
shell.nix Normal file
View file

@ -0,0 +1,40 @@
let
nixpkgs = builtins.fetchGit {
name = "nixos-23.11";
url = "https://github.com/nixos/nixpkgs";
ref = "refs/heads/nixos-23.11";
};
nixpkgs-unstable = builtins.fetchGit {
name = "nixos-unstable";
url = "https://github.com/nixos/nixpkgs";
ref = "refs/heads/nixos-unstable";
};
pkgs = import nixpkgs {};
pkgs-unstable = import nixpkgs-unstable {};
in pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkgs-unstable.rustc
pkgs-unstable.rustfmt
pkgs-unstable.cargo
pkgs-unstable.clippy
gcc
cmake
pkg-config
];
buildInputs = with pkgs; [
gtk4
glib
gdk-pixbuf
gobject-introspection
libadwaita
];
RUST_SRC_PATH = "${pkgs-unstable.rust.packages.stable.rustPlatform.rustLibSrc}";
RUST_BACKTRACE = 1;
}