Commit d5e1048 1 parent 8a43018 commit d5e1048 Copy full SHA for d5e1048
File tree 2 files changed +28
-58
lines changed
pkgs/by-name/rm/rmfakecloud
2 files changed +28
-58
lines changed Original file line number Diff line number Diff line change 2
2
lib ,
3
3
fetchFromGitHub ,
4
4
buildGoModule ,
5
- callPackage ,
6
5
enableWebui ? true ,
6
+ pnpm_9 ,
7
+ nodejs ,
7
8
nixosTests ,
8
9
} :
9
10
@@ -20,17 +21,32 @@ buildGoModule rec {
20
21
21
22
vendorHash = "sha256-9tfxE03brUvCYusmewiqNpCkKyIS9qePqylrzDWrJLY=" ;
22
23
23
- ui = callPackage ./webui.nix { inherit version src ; } ;
24
-
25
- postPatch =
26
- if enableWebui then
27
- ''
28
- cp -a ${ ui } ui/dist
29
- ''
30
- else
31
- ''
32
- sed -i '/go:/d' ui/assets.go
33
- '' ;
24
+ # if using webUI build it
25
+ pnpmRoot = "ui" ;
26
+ pnpmDeps = pnpm_9 . fetchDeps {
27
+ inherit pname version src ;
28
+ sourceRoot = "${ src . name } /ui" ;
29
+ pnpmLock = "${ src } /ui/pnpm-lock.yaml" ;
30
+ hash = "sha256-VNmCT4um2W2ii8jAm+KjQSjixYEKoZkw7CeRwErff/o=" ;
31
+ } ;
32
+ preBuild = lib . optionals enableWebui ''
33
+ # using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart
34
+ rm -r ui/node_modules/sass-embedded ui/node_modules/.pnpm/sass-embedded*
35
+
36
+ # avoid re-running pnpm i...
37
+ touch ui/pnpm-lock.yaml
38
+
39
+ make ui/dist
40
+ '' ;
41
+ nativeBuildInputs = lib . optionals enableWebui [
42
+ nodejs
43
+ pnpm_9 . configHook
44
+ ] ;
45
+
46
+ # ... or don't embed it in the server
47
+ postPatch = lib . optionals ( ! enableWebui ) ''
48
+ sed -i '/go:/d' ui/assets.go
49
+ '' ;
34
50
35
51
ldflags = [
36
52
"-s"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments