-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (59 loc) · 1.82 KB
/
flake.nix
File metadata and controls
69 lines (59 loc) · 1.82 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 = "CUC Bus Sign";
nixConfig = {
extra-substituters = [ "https://scottylabs.cachix.org" ];
extra-trusted-public-keys = [
"scottylabs.cachix.org-1:hajjEX5SLi/Y7yYloiXTt2IOr3towcTGRhMh1vu6Tjg="
];
};
inputs = {
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
devenv.url = "github:cachix/devenv";
bun2nix = {
url = "github:nix-community/bun2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, devenv, bun2nix, ... }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system: nixpkgs.legacyPackages.${system};
in
{
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
devenv = devenv.packages.${system}.devenv;
}
// (nixpkgs.lib.optionalAttrs (system == "x86_64-linux") (
let
b2n = bun2nix.packages.${system}.default;
busSignFrontend = b2n.mkDerivation {
pname = "bus-sign-frontend";
version = (builtins.fromJSON (builtins.readFile ./frontend/package.json)).version;
src = ./frontend;
bunDeps = b2n.fetchBunDeps {
bunNix = ./frontend/bun.nix;
};
buildPhase = ''
bun run build
'';
installPhase = ''
mkdir -p $out
cp -r dist/* $out/
'';
};
cargoNix = pkgs.callPackage ./Cargo.nix { };
busSignBackend = cargoNix.rootCrate.build;
in
{
inherit busSignFrontend busSignBackend;
default = busSignBackend;
}
))
);
};
}