-
Notifications
You must be signed in to change notification settings - Fork 46
/
flake.nix
71 lines (64 loc) · 1.77 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
{
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;};
apps = {
};
packages = {
target-cli = llvm.stdenv.mkDerivation {
name = "cspotcli";
src = ./.;
cmakeFlags = ["-DCSPOT_TARGET_CLI=ON"];
nativeBuildInputs = with pkgs; [
avahi
avahi-compat
cmake
ninja
python3
python3Packages.protobuf
python3Packages.setuptools
unstable.mbedtls
portaudio
protobuf
];
# Patch nanopb shebangs to refer to provided python
postPatch = ''
patchShebangs cspot/bell/external/nanopb/generator/*
'';
enableParallelBuilding = true;
};
};
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [cmake unstable.mbedtls ninja python3] ++ [clang-tools llvm.clang];
};
};
in {
inherit apps devShells packages;
checks = packages;
devShell = devShells.default;
});
}