-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (61 loc) · 1.9 KB
/
flake.nix
File metadata and controls
69 lines (61 loc) · 1.9 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
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 ]; };
pname = "accentor-web";
version = "0.34.0";
deps = pkgs.mkYarnModules {
inherit version;
pname = "${pname}-modules";
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
};
in
{
packages = rec {
default = accentor-web;
accentor-web = pkgs.stdenv.mkDerivation (finalAttrs: {
inherit pname version;
src = pkgs.lib.cleanSourceWith { filter = name: type: !(builtins.elem name [ ".github" "flake.lock" "flake.nix" ]); src = ./.; name = "${pname}-${version}-source"; };
nativeBuildInputs = [ (pkgs.yarn.override { nodejs = pkgs.nodejs_22; }) ];
configurePhase = ''
cp -r ${deps}/node_modules/ .
'';
buildPhase = ''
yarn run build
'';
installPhase = ''
cp -r dist $out
'';
distPhase = "true";
});
};
devShells = rec {
default = accentor-web;
accentor-web = pkgs.devshell.mkShell {
name = "Accentor Web";
packages = with pkgs; [
nixpkgs-fmt
yarn2nix
(yarn.override { nodejs = nodejs_22; })
];
};
};
}
);
}