Commit de4a766 1 parent 1182bd0 commit de4a766 Copy full SHA for de4a766
File tree 2 files changed +29
-58
lines changed
pkgs/by-name/rm/rmfakecloud
2 files changed +29
-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,33 @@ 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
+ # use env because of https://github.com/NixOS/nixpkgs/issues/358844
26
+ env . pnpmRoot = "ui" ;
27
+ env . pnpmDeps = pnpm_9 . fetchDeps {
28
+ inherit pname version src ;
29
+ sourceRoot = "${ src . name } /ui" ;
30
+ pnpmLock = "${ src } /ui/pnpm-lock.yaml" ;
31
+ hash = "sha256-VNmCT4um2W2ii8jAm+KjQSjixYEKoZkw7CeRwErff/o=" ;
32
+ } ;
33
+ preBuild = lib . optionals enableWebui ''
34
+ # using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart
35
+ rm -r ui/node_modules/sass-embedded ui/node_modules/.pnpm/sass-embedded*
36
+
37
+ # avoid re-running pnpm i...
38
+ touch ui/pnpm-lock.yaml
39
+
40
+ make ui/dist
41
+ '' ;
42
+ nativeBuildInputs = lib . optionals enableWebui [
43
+ nodejs
44
+ pnpm_9 . configHook
45
+ ] ;
46
+
47
+ # ... or don't embed it in the server
48
+ postPatch = lib . optionals ( ! enableWebui ) ''
49
+ sed -i '/go:/d' ui/assets.go
50
+ '' ;
34
51
35
52
ldflags = [
36
53
"-s"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments