forked from soywod/react-pin-field
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
57 lines (54 loc) · 1.59 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
{
description = "React component for entering PIN codes";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, utils, ... }:
utils.lib.eachDefaultSystem
(system:
let
name = (builtins.fromJSON (builtins.readFile ./package.json)).name;
pkgs = import nixpkgs { inherit system; };
yarn-run = "yarn run --offline --ignore-scripts --ignore-engines --";
in
rec {
# nix build
defaultPackage = pkgs.yarn2nix-moretea.mkYarnPackage {
inherit name;
src = ./.;
extraBuildInputs = with pkgs; [
ripgrep
rnix-lsp
nixpkgs-fmt
nodePackages.prettier
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vscode-json-languageserver
nodePackages.vscode-css-languageserver-bin
];
configurePhase = ''
ln -s $node_modules node_modules
'';
buildPhase = ''
${yarn-run} next build
${yarn-run} next export -o $out
'';
installPhase = ''
exit
'';
distPhase = ''
exit
'';
};
# nix develop
devShell = pkgs.mkShell {
inputsFrom = [ self.defaultPackage.${system} ];
};
}
);
}