-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
45 lines (41 loc) · 1.04 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
{
description = "Workspaces for Firefox";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
npm-buildpackage.url = "github:serokell/nix-npm-buildpackage";
};
outputs = { self, nixpkgs, utils, npm-buildpackage, ... }:
let
name = "wksp-for-firefox";
in
utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
project = npm-buildpackage.buildYarnPackage {
src = ./.;
yarnBuild = "yarn build";
};
buildInputs = with pkgs; [
nodejs
];
nativeBuildInputs = with pkgs; [
nixpkgs-fmt
];
in
rec {
packages.${name} = project;
# `nix build`
defaultPackage = packages.${name};
# `nix develop`
devShell = pkgs.mkShell {
inherit buildInputs nativeBuildInputs;
};
}
);
}