Skip to content

Commit e01c61a

Browse files
committed
nix: Move from shell.nix to flake.nix
This reduces the risk of changes in dependencies and used a pinned set of libraries and tools. Signed-off-by: Otavio Salvador <[email protected]>
1 parent 6e31cf6 commit e01c61a

File tree

4 files changed

+79
-19
lines changed

4 files changed

+79
-19
lines changed

.envrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
use nix
1+
use flake
2+
3+
# Keep this until https://github.com/nix-community/nix-direnv/issues/109 is resolved
4+
eval "$shellHook"

flake.lock

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
description = "compress-tools-rs";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-21.11";
6+
flake-utils = {
7+
url = "github:numtide/flake-utils";
8+
inputs.nixpkgs.follows = "nixpkgs";
9+
};
10+
};
11+
12+
outputs = { self, nixpkgs, flake-utils }:
13+
flake-utils.lib.eachDefaultSystem (system:
14+
let
15+
pkgs = nixpkgs.legacyPackages.${system};
16+
in
17+
{
18+
devShell = pkgs.mkShell {
19+
buildInputs = with pkgs; [
20+
rust-bindgen
21+
pkg-config
22+
libarchive
23+
clang
24+
llvmPackages.libclang
25+
];
26+
27+
# why do we need to set the library path manually?
28+
shellHook = ''
29+
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang}/lib";
30+
'';
31+
};
32+
});
33+
}

shell.nix

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)