-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (71 loc) · 2.19 KB
/
Copy pathflake.nix
File metadata and controls
79 lines (71 loc) · 2.19 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "Shift Editor development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { nixpkgs, rust-overlay, ... }:
let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
in
{
devShells = nixpkgs.lib.genAttrs systems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rustToolchainToml = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)).toolchain;
rustToolchain = pkgs.rust-bin.stable.${rustToolchainToml.channel}.default.override {
extensions = rustToolchainToml.components ++ [ "rust-analyzer" ];
targets = rustToolchainToml.targets or [ ];
};
pnpm = pkgs.writeShellScriptBin "pnpm" ''
export COREPACK_ENABLE_DOWNLOAD_PROMPT="0"
export COREPACK_HOME="''${COREPACK_HOME:-''${XDG_CACHE_HOME:-$HOME/.cache}/corepack}"
exec ${pkgs.nodejs_24}/bin/corepack pnpm "$@"
'';
commonPackages = with pkgs; [
cmake
git
nodejs_24
pkg-config
pnpm
python3
rustToolchain
sqlite
];
linuxPackages = with pkgs; lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
at-spi2-atk
cups
dbus
fluxbox
gtk3
nss
xvfb-run
libx11
libxscrnsaver
libxtst
libxkbfile
];
darwinPackages = with pkgs; lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
in
{
default = pkgs.mkShell {
packages = commonPackages ++ linuxPackages ++ darwinPackages;
shellHook = ''
export COREPACK_ENABLE_DOWNLOAD_PROMPT="0"
echo "Shift dev shell: node $(node --version), pnpm $(pnpm --version), rustc $(rustc --version)"
'';
};
});
};
}