-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (62 loc) · 2.01 KB
/
Copy pathflake.nix
File metadata and controls
70 lines (62 loc) · 2.01 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
70
{
description = "icey-server packaged as a Nix flake";
inputs =
let
trim = s: builtins.replaceStrings ["\n" "\r"] ["" ""] s;
iceyVersion = trim (builtins.readFile ./ICEY_VERSION);
in {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
icey = {
url = "github:nilstate/icey/${iceyVersion}";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, icey }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
version = builtins.replaceStrings ["\n" "\r"] ["" ""] (builtins.readFile ./VERSION);
in {
packages.default = pkgs.stdenv.mkDerivation {
pname = "icey-server";
inherit version;
src = self;
nativeBuildInputs = with pkgs; [
cmake
nodejs
pkg-config
];
buildInputs = with pkgs; [
ffmpeg
openssl
];
buildPhase = ''
runHook preBuild
npm --prefix web ci
npm --prefix web run build
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DICEY_SOURCE_DIR=${icey}
cmake --build build -j1 --target icey-server
runHook postBuild
'';
installPhase = ''
runHook preInstall
cmake --install build --prefix $out --component apps
runHook postInstall
'';
meta = with pkgs.lib; {
description = "Self-hosted source-to-browser server built on icey";
homepage = "https://github.com/nilstate/icey-cli";
license = licenses.agpl3Plus;
platforms = platforms.linux ++ platforms.darwin;
mainProgram = "icey-server";
};
};
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.default;
exePath = "/bin/icey-server";
};
});
}