-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathdefault.nix
More file actions
70 lines (59 loc) · 1.42 KB
/
default.nix
File metadata and controls
70 lines (59 loc) · 1.42 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
{ }:
let
sources = import ./sources.nix { };
pkgs = import sources.nixpkgs { };
zigbee2mqtt-networkmap = pkgs.callPackage (
{
lib,
stdenv,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
nodejs,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "zigbee2mqtt-networkmap";
version = "0";
src =
with lib.fileset;
toSource {
root = ./.;
fileset = difference ./. (unions [
(maybeMissing ./node_modules)
(maybeMissing ./result)
./default.nix
./sources.lock
./sources.nix
]);
};
offlineCache = fetchYarnDeps {
inherit (finalAttrs) src;
hash = "sha256-KRyAN51xaW3WoF4KyFyrM7WtbYN/NXHj3FzXoVeN3uQ=";
};
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];
installPhase = ''
runHook preInstall
mkdir $out
cp -v dist/* $out/
runHook postInstall
'';
dontFixup = true;
shellHook = ''
# Run yarnConfigHook in subshell, so $HOME will retain
test -e node_modules || (yarnConfigHook)
'';
})
) { };
in
zigbee2mqtt-networkmap
// {
inherit zigbee2mqtt-networkmap;
# nix run -f . update
update = pkgs.writeShellScriptBin "update" ''
${pkgs.nix-update}/bin/nix-update zigbee2mqtt-networkmap --version=skip
'';
}