Skip to content

Commit d116c5f

Browse files
Merge pull request #391 from 0x5A69656C/ripasso-nix
Added flake.nix default.nix for building on nix systems
2 parents e14188a + 7d8feab commit d116c5f

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

default.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
rustPlatform,
3+
glib,
4+
pkg-config,
5+
}:
6+
rustPlatform.buildRustPackage {
7+
name = "ripasso";
8+
src = ./.;
9+
buildInputs = [ glib ];
10+
nativeBuildInputs = [ pkg-config ];
11+
cargoHash = "sha256-UMhQgijZuZW2O/0Jk5Zn8P368KnDWZRXj5e1nDG40Gw=";
12+
}

flake.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
description = "Rust flake";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs, ... }@inputs:
9+
let
10+
system = "x86_64-linux";
11+
pkgs = import nixpkgs { inherit system; };
12+
13+
clangLibPath = "${pkgs.libclang.lib}/lib";
14+
opensslDev = pkgs.openssl.dev;
15+
opensslOut = pkgs.openssl.out;
16+
in
17+
{
18+
devShells.${system}.default = pkgs.mkShell {
19+
packages = with pkgs; [
20+
rustc
21+
cargo
22+
clang
23+
libclang
24+
openssl
25+
pkg-config
26+
libgpg-error
27+
nettle
28+
gpgme
29+
ripasso-cursive
30+
];
31+
32+
shellHook = ''
33+
# Clang
34+
export LIBCLANG_PATH=${clangLibPath}
35+
export LD_LIBRARY_PATH=${clangLibPath}:${opensslOut}/lib:$LD_LIBRARY_PATH
36+
37+
# OpenSSL
38+
export OPENSSL_NO_VENDOR=1
39+
export OPENSSL_LIB_DIR=${opensslOut}/lib
40+
export OPENSSL_INCLUDE_DIR=${opensslDev}/include
41+
42+
echo " LIBCLANG_PATH = $LIBCLANG_PATH"
43+
echo " LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
44+
echo " OPENSSL_LIB_DIR = $OPENSSL_LIB_DIR"
45+
echo " OPENSSL_INCLUDE_DIR = $OPENSSL_INCLUDE_DIR"
46+
'';
47+
};
48+
};
49+
}

0 commit comments

Comments
 (0)