From 222eb72da97784c76cc477a708fd06425461de77 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Sat, 25 May 2024 12:21:32 +0200 Subject: [PATCH 1/2] build: added `shell.nix` and direnv integration --- .envrc | 1 + .gitignore | 1 + shell.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/.gitignore b/.gitignore index 9b8adcb..629f81b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target +/.direnv flamegraph.svg perf.data* diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..1cc9698 --- /dev/null +++ b/shell.nix @@ -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; +} From d8a43562f807e67a62b9153163c85c9c0a011a14 Mon Sep 17 00:00:00 2001 From: Nikita Podvirnyi Date: Sun, 26 May 2024 20:56:39 +0200 Subject: [PATCH 2/2] feat: updated shell.nix --- shell.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shell.nix b/shell.nix index 1cc9698..250d8bc 100644 --- a/shell.nix +++ b/shell.nix @@ -16,9 +16,8 @@ let in pkgs.mkShell { nativeBuildInputs = with pkgs; [ - pkgs-unstable.rustc + pkgs-unstable.rustup pkgs-unstable.rustfmt - pkgs-unstable.cargo pkgs-unstable.clippy gcc @@ -34,7 +33,4 @@ in pkgs.mkShell { libadwaita ]; - - RUST_SRC_PATH = "${pkgs-unstable.rust.packages.stable.rustPlatform.rustLibSrc}"; - RUST_BACKTRACE = 1; }