Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
85 lines (81 loc) · 2.36 KB
/
Copy pathflake.nix
File metadata and controls
85 lines (81 loc) · 2.36 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
80
81
82
83
84
85
{
description = "powershellScripts 显式 nix develop 开发环境(不接管宿主安装链)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
systems = [
"aarch64-darwin"
"x86_64-linux"
];
forAllSystems =
f:
nixpkgs.lib.genAttrs systems (
system:
f (
import nixpkgs {
inherit system;
config = { };
}
)
);
in
{
devShells = forAllSystems (
pkgs:
let
pester = import ./nix/pester.nix { inherit pkgs; };
pnpmWrapper = import ./nix/pnpm-wrapper.nix { inherit pkgs; };
# 最小构建工具:qa / cargo / bash 测试
buildTools = with pkgs; [
gnumake
python3
bash
coreutils
findutils
gnugrep
gnused
gawk
which
curl
cacert
unzip
];
in
{
default = pkgs.mkShell {
name = "powershellScripts-dev";
packages = with pkgs; [
nodejs_24
pnpmWrapper
powershell
rustc
cargo
clippy
rustfmt
git
pester
]
++ buildTools;
shellHook = ''
# 进程级变量;不写 HOME/rc,不自动 install
export NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
export SSL_CERT_FILE="$NIX_SSL_CERT_FILE"
export COREPACK_HOME="''${COREPACK_HOME:-$HOME/.cache/node/corepack}"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export COREPACK_ENABLE_AUTO_PIN=0
export PSModulePath="${pester}/share/powershell/Modules''${PSModulePath:+:$PSModulePath}"
echo "powershellScripts nix develop"
echo " node: $(command -v node) -> $(node -v 2>/dev/null || true)"
echo " pnpm: $(command -v pnpm)"
echo " pwsh: $(command -v pwsh)"
echo " rustc: $(command -v rustc) -> $(rustc --version 2>/dev/null || true)"
echo " Pester module root prepended from Nix store"
'';
};
}
);
};
}