-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
42 lines (40 loc) · 1.21 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
{
description = "csvs - comma-separated value store";
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; };
outputs = inputs@{ self, nixpkgs, ... }:
let
eachSystem = systems: f:
let
op = attrs: system:
let
ret = f system;
op = attrs: key:
let
appendSystem = key: system: ret: { ${system} = ret.${key}; };
in attrs // {
${key} = (attrs.${key} or { })
// (appendSystem key system ret);
};
in builtins.foldl' op attrs (builtins.attrNames ret);
in builtins.foldl' op { } systems;
defaultSystems = [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
in eachSystem defaultSystems (system:
let
pkgs = import nixpkgs { inherit system; };
csvs-js = pkgs.mkYarnPackage rec {
name = "csvs-js";
src = ./.;
};
in rec {
devShell =
pkgs.mkShell { buildInputs = with pkgs; [ nodejs-16_x yarn ]; };
packages = { inherit csvs-js; };
defaultPackage = csvs-js;
});
}