-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (46 loc) · 1.55 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
# SPDX-FileCopyrightText: 2022 localthomas
#
# SPDX-License-Identifier: MIT OR Apache-2.0
{
description = "This is a music player realized as web app";
inputs = {
# for eachSystem function
flake-utils.url = "github:numtide/flake-utils";
# use flake-compat as side-effect for flake.lock file that is read by shell.nix
# fill the flake.lock file with `nix flake lock --update-input flake-compat`
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
npmlock2nix = {
url = "github:nix-community/npmlock2nix";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, npmlock2nix, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = import nixpkgs {
inherit system;
};
nodejs = pkgs.nodejs;
# npmlock2nix-eval can be used as https://github.com/nix-community/npmlock2nix/blob/master/API.md
npmlock2nix-eval = pkgs.callPackage npmlock2nix { };
in
{
devShell = pkgs.mkShell {
nativeBuildInputs = [ pkgs.nixpkgs-fmt nodejs ];
};
# dev shell containing the node_modules data
# this does not work currently due to a bug in npmlock2nix or npm:
# https://github.com/nix-community/npmlock2nix/issues/45
#devShell = npmlock2nix-eval.shell
# {
# src = ./.;
# # use copy, as vite needs to create a folder "node_modules/.vite"
# node_modules_mode = "copy";
# inherit nodejs;
# };
}
);
}