-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathflake.nix
44 lines (39 loc) · 1.07 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
{
description = "texthooker-ui";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
name = "texthooker-ui";
src = ./.;
pkgs = import nixpkgs {inherit system;};
nativeBuildInputs = with pkgs; [nodejs pnpm.configHook];
in {
# index.html will be located in the nix store
# build with "nix build . --print-out-paths" to get the path
packages.default = pkgs.stdenv.mkDerivation (finalAttrs: {
inherit name nativeBuildInputs src;
pname = name;
pnpmDeps = pkgs.pnpm.fetchDeps {
pname = name;
inherit src;
hash = "sha256-Wqs3aO4uq/5eqVmp9FFZNVEWo/TpwDib9PJFABmFrbk=";
};
installPhase = ''
pnpm run build
cp -r ./docs $out
'';
});
devShell = pkgs.mkShell {
inherit nativeBuildInputs;
};
}
);
}