-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdefault.nix
More file actions
83 lines (65 loc) · 1.61 KB
/
Copy pathdefault.nix
File metadata and controls
83 lines (65 loc) · 1.61 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
{
lib,
stdenv,
nix-gitignore,
yarn-berry,
nodejs,
cacert,
versions ? null,
}: stdenv.mkDerivation (final: let
nodeModules = stdenv.mkDerivation {
pname = "${final.pname}-node_modules";
version = final.version;
src = final.src;
nativeBuildInputs = [ nodejs yarn-berry cacert ];
configurePhase = ''
mkdir garbage-tooling
cat <<EOF > .yarnrc.yml
enableTelemetry: false
enableInlineBuilds: true
enableProgressBars: false
enableGlobalCache: false
nodeLinker: node-modules
EOF
'';
buildPhase = ''
HOME=$(pwd)/garbage-tooling yarn install
'';
installPhase = ''
# none of the cache path configs in yarnrc actually do anything
# so we just copy node_modules manually
mv node_modules $out
'';
fixupPhase = "true";
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "b/QWXZLKv6qq5V/wMjuGBnKdf9c8lf0LDRSU5W/LWVc=";
};
in {
pname = "quickshell-web";
version = "0.1.0";
src = nix-gitignore.gitignoreSource [] ./.;
nativeBuildInputs = [ yarn-berry ];
configurePhase = ''
mkdir garbage-tooling
cat <<EOF > .yarnrc.yml
enableInlineBuilds: true
enableProgressBars: false
enableGlobalCache: false
enableNetwork: false
nodeLinker: node-modules
EOF
cp -r ${nodeModules} node_modules
chmod +rw -R node_modules
'';
PRODUCTION = true;
VERSION_FILE_PATH = versions;
buildPhase = ''
HOME=$(pwd)/garbage-tooling yarn build
'';
installPhase = ''
mkdir -p $out
mv redirects.caddyfile $out
mv dist $out/site
'';
})