This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
92 lines (92 loc) · 2.73 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{
inputs.nixpkgs-repo.url = "github:NixOS/nixpkgs/6fc7203e423bbf1c8f84cccf1c4818d097612566";
inputs.npmlock2nix-repo = { url = "github:nix-community/npmlock2nix?rev=9197bbf397d76059a76310523d45df10d2e4ca81"; flake = false; };
outputs = { self, nixpkgs-repo, npmlock2nix-repo }:
let
nixpkgs = nixpkgs-repo;
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
packages = forAllSystems (system:
let
pkgs = import "${nixpkgs}" {
config.allowUnfree = true;
inherit system;
};
in
{
"app_node_modules" =
let
npmlock2nix = import npmlock2nix-repo {
inherit pkgs;
};
pkgs = import "${nixpkgs}" {
config.permittedInsecurePackages = [ ];
inherit system;
};
in
npmlock2nix.v2.node_modules
{
src = (
let
lib = pkgs.lib;
lastSafe = list:
if lib.lists.length list == 0
then null
else lib.lists.last list;
in
builtins.path
{
path = ./.;
name = "source";
filter = path: type:
let
fileName = lastSafe (lib.strings.splitString "/" path);
in
fileName != "flake.nix" &&
fileName != "garn.ts";
}
);
nodejs = pkgs.nodejs-18_x;
};
}
);
checks = forAllSystems (system:
let
pkgs = import "${nixpkgs}" {
config.allowUnfree = true;
inherit system;
};
in
{ }
);
devShells = forAllSystems (system:
let
pkgs = import "${nixpkgs}" {
config.allowUnfree = true;
inherit system;
};
in
{
"app" = ((pkgs.mkShell { }).overrideAttrs (finalAttrs: previousAttrs: {
nativeBuildInputs =
previousAttrs.nativeBuildInputs
++
[ pkgs.nodejs-18_x ];
})).overrideAttrs (finalAttrs: previousAttrs: {
nativeBuildInputs =
previousAttrs.nativeBuildInputs
++
[ pkgs.bun ];
});
}
);
apps = forAllSystems (system:
let
pkgs = import "${nixpkgs}" { inherit system; };
in
{ }
);
};
}