This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
66 lines (61 loc) · 1.87 KB
/
flake.nix
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
58
59
60
61
62
63
64
65
66
{
# Nix: https://nixos.org/download.html
# How to activate flakes: https://nixos.wiki/wiki/Flakes
# For seamless integration, consider using:
# - direnv: https://github.com/direnv/direnv
# - nix-direnv: https://github.com/nix-community/nix-direnv
#
# # .envrc
# use flake
# dotenv .env
#
description = "Pathfinder desktop app development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
nixpkgs,
flake-utils,
...
}: let
systems = flake-utils.lib.system;
in
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
defaultShellConf = {
nativeBuildInputs = with pkgs;
[
nodePackages.pnpm
nodejs
nodePackages.prettier
nodePackages.typescript
nodePackages.typescript-language-server
# Rust
rustup
curl
wget
pkg-config
libiconv
]
++ nixpkgs.lib.optional (system == systems.aarch64-darwin) [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.AppKit
darwin.apple_sdk.frameworks.WebKit
darwin.apple_sdk.frameworks.Cocoa
];
shellHook = ''
project_root="$(git rev-parse --show-toplevel 2>/dev/null || jj workspace root 2>/dev/null)"
export CARGO_INSTALL_ROOT="$project_root/apps/desktop/.cargo";
export PATH="$CARGO_INSTALL_ROOT/bin:$project_root/node_modules/.bin:$PATH";
'';
};
in {
devShells.default = pkgs.mkShell defaultShellConf;
});
}