-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
71 lines (64 loc) · 2.06 KB
/
Copy pathflake.nix
File metadata and controls
71 lines (64 loc) · 2.06 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, crane, flake-utils }:
flake-utils.lib.eachDefaultSystem(system:
let
pkgs = import nixpkgs {
inherit system;
};
deps = with pkgs; [
mold
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
craneLib = crane.mkLib pkgs;
campus-playout = craneLib.buildPackage {
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type: (craneLib.filterCargoSources path type)
|| (builtins.match ".*/src/assets/.*$" path != null)
|| (builtins.match ".*/migrations/.*\\.sql$" path != null)
|| (builtins.match ".*/.sqlx/.*\\.json$" path != null);
name = "source";
};
buildInputs = deps;
};
campus-playout-streamer = pkgs.stdenv.mkDerivation {
pname = "campus-playout-streamer";
version = "0.1.0";
src = ./scripts;
nativeBuildInputs = [ pkgs.makeWrapper ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,libexec}
cp $src/*.liq $out/libexec
makeWrapper ${pkgs.lib.getExe pkgs.liquidsoap} $out/bin/campus-playout-streamer \
--add-flags $out/libexec/playout.liq
'';
};
in
{
packages = {
default = campus-playout;
inherit campus-playout campus-playout-streamer;
docker = pkgs.callPackage ./docker.nix {
inherit campus-playout campus-playout-streamer;
};
};
devShells.default = craneLib.devShell {
packages = with pkgs; [
sqlx-cli
liquidsoap
rust-analyzer
sqlite
] ++ deps;
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath deps}";
};
}
);
}