forked from madjam002/yarnpnp2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (47 loc) · 1.32 KB
/
flake.nix
File metadata and controls
49 lines (47 loc) · 1.32 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
{
description = "yarnpnp2nix";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
utils.url = "github:numtide/flake-utils";
flake-compat ={
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, utils, ... }:
let
overlay = final: prev: {
yarnBerry = final.callPackage ./yarn.nix {};
yarn-plugin-yarnpnp2nix = final.callPackage ./yarnPlugin.nix {};
yarnpnp2nixLib = import ./lib/mkYarnPackage.nix { defaultPkgs = final; lib = final.lib; };
};
in (utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [overlay];
};
in
rec {
packages = {
default = pkgs.yarn-plugin-yarnpnp2nix;
yarn-plugin = pkgs.yarn-plugin-yarnpnp2nix;
yarnBerry = pkgs.yarnBerry;
yarnpnp2nix-test = pkgs.writeShellApplication {
name = "yarnpnp2nix-test";
runtimeInputs = [ pkgs.jq ];
text = builtins.readFile ./runTests.sh;
};
};
lib = pkgs.yarnpnp2nixLib;
devShell = pkgs.mkShell {
packages = with pkgs; [
nodejs
yarnBerry
];
};
}
))
//
{ overlays.default = overlay; };
}