-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
47 lines (47 loc) · 1.35 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, ... }:
inputs.utils.lib.eachSystem ["x86_64-linux"] (system:
let pkgs = inputs.nixpkgs.legacyPackages.${system}; in
{
# formatter = pkgs.nodejs.pkgs.prettier; # TODO: write inplace
packages.default = with pkgs; let
package = (with builtins; fromJSON (readFile ./package.json));
in
buildNpmPackage {
pname = package.name;
version = package.version;
src = ./.;
npmDepsHash = "sha256-a1Hlki3xWBHJXhYlAjh8X6xGYFoB7owMXLDgiYLxmCU=";
nativeBuildInputs = [
python310
nodejs.pkgs.node-gyp-build
pkg-config
];
buildInputs = [ ]
++ (with xorg; [
libX11
libXi
libXext
libGL
]);
installPhase = ''
cp -r www $out
'';
};
devShells.default = with pkgs; mkShell {
inputsFrom = builtins.attrValues self.packages.${system};
shellHook = ''
export PATH="$PATH:$PWD/node_modules/.bin"
'';
buildInputs = [
chromium
vkeybd
];
CHROME_BIN="${chromium}/bin/chromium";
};
});
}