-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
57 lines (55 loc) · 1.77 KB
/
Copy pathflake.nix
File metadata and controls
57 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
description = "Hellas Gate local desktop development shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cargo-tauri
clang
esbuild
nodejs
pkg-config
rust
typescript
];
buildInputs = with pkgs; lib.optionals stdenv.hostPlatform.isLinux [
sqlite
atk
cairo
gdk-pixbuf
glib
glib-networking
gtk3
libsoup_3
libappindicator-gtk3
pango
webkitgtk_4_1
];
shellHook = ''
export CARGO_TARGET_DIR="''${CARGO_TARGET_DIR:-/tmp/hellas-gate-target}"
'' + pkgs.lib.optionalString pkgs.stdenv.hostPlatform.isDarwin ''
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
export SDKROOT="$(/usr/bin/xcrun --sdk macosx --show-sdk-path)"
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=/usr/bin/clang
export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/usr/bin/clang
'';
};
});
}