forked from feelfreelinux/cspot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
73 lines (65 loc) · 1.74 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
64
65
66
67
68
69
70
71
72
73
{
description = "cspot - A Spotify Connect player written in CPP targeting, but not limited to embedded devices (ESP32).";
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
flake-utils,
}: let
overlay = final: prev: {
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
};
in
{
overlays.default = overlay;
}
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [overlay];
};
llvm = pkgs.llvmPackages_14;
clang-tools = pkgs.clang-tools.override {llvmPackages = llvm;};
cspot-pkgs = with pkgs; [
avahi
avahi-compat
cmake
ninja
python3
python3Packages.protobuf
python3Packages.setuptools
unstable.mbedtls
portaudio
protobuf
];
apps = {
};
packages = {
target-cli = llvm.stdenv.mkDerivation {
name = "cspotcli";
src = ./.;
cmakeFlags = ["-DCSPOT_TARGET_CLI=ON"];
nativeBuildInputs = cspot-pkgs;
# Patch nanopb shebangs to refer to provided python
postPatch = ''
patchShebangs cspot/bell/external/nanopb/generator/*
'';
enableParallelBuilding = true;
};
};
devShells = {
default = pkgs.mkShell {
packages = cspot-pkgs;
};
};
in {
inherit apps devShells packages;
checks = packages;
devShell = devShells.default;
});
}