-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
63 lines (56 loc) · 1.75 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
{
description = "Accentor Web";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
};
outputs = { self, nixpkgs, devshell, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ devshell.overlays.default ]; };
in
{
packages = rec {
default = accentor-web;
accentor-web = pkgs.mkYarnPackage rec {
pname = "accentor-web";
version = "0.33.0";
src = pkgs.lib.cleanSourceWith { filter = name: type: !(builtins.elem name [ ".github" "flake.lock" "flake.nix" ]); src = ./.; name = "source"; };
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
# Otherwise this tries to write to read-only paths, and caching is unnecessary anyway.
SKIP_CACHE = "true";
buildPhase = ''
cp deps/accentor/postcss.config.js .
yarn run build
'';
installPhase = ''
cp -r deps/accentor/dist $out
rm $out/**/*.map
'';
distPhase = "true";
};
};
devShells = rec {
default = accentor-web;
accentor-web = pkgs.devshell.mkShell {
name = "Accentor Web";
packages = with pkgs; [
nixpkgs-fmt
yarn2nix
yarn
];
};
};
}
);
}