-
Notifications
You must be signed in to change notification settings - Fork 39
/
flake.nix
74 lines (66 loc) · 2.01 KB
/
flake.nix
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
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
fedimint = {
# master on 2024-08-12
url =
"github:fedimint/fedimint?rev=04ddaf35090548972008b45c482d8ad20abd22ef";
};
};
outputs = { self, flake-utils, fedimint }:
flake-utils.lib.eachDefaultSystem (system:
let
nixpkgs = fedimint.inputs.nixpkgs;
pkgs = import nixpkgs {
inherit system;
overlays = fedimint.overlays.fedimint;
};
fmLib = fedimint.lib.${system};
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = ./yarn.lock;
hash = "sha256-lJcqjTwC5C+4rvug6RYg8Ees4SzNTD+HazfACz1EaSQ=";
};
in {
devShells = fmLib.devShells // {
default = fmLib.devShells.default.overrideAttrs (prev: {
nativeBuildInputs = [
pkgs.mprocs
pkgs.nodejs
pkgs.yarn
fedimint.packages.${system}.devimint
fedimint.packages.${system}.gateway-pkgs
fedimint.packages.${system}.fedimint-pkgs
] ++ prev.nativeBuildInputs;
shellHook = ''
yarn install
'';
});
};
packages.guardian-ui = pkgs.stdenv.mkDerivation {
pname = "guardian-ui";
version = "0.3.0";
src = ./.;
nativeBuildInputs = with pkgs; [
nodejs
yarn
yarn2nix-moretea.fixup_yarn_lock
];
configurePhase = ''
export HOME=$(mktemp -d)
'';
buildPhase = ''
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
fixup_yarn_lock yarn.lock
yarn install --offline \
--frozen-lockfile \
--ignore-engines --ignore-scripts
patchShebangs .
yarn build:guardian-ui
'';
installPhase = ''
mkdir -p $out
cp -R apps/guardian-ui/build/* $out
'';
};
});
}