-
Notifications
You must be signed in to change notification settings - Fork 15
/
flake.nix
107 lines (87 loc) · 2.59 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "X11 Audio Visualizer for ALSA";
outputs = { self, nixpkgs }:
let
systems =
[ "x86_64-linux" "aarch64-linux" ];
# Need to validate before pushing "x86_64-darwin" "aarch64-darwin"
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in rec {
overlay = final: prev: {
xava = final.stdenv.mkDerivation {
name = "xava";
version = "unstable";
description = "X11 Audio Visualizer for ALSA";
src = self;
cmakeFlags = [
(final.lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" true)
"-DNIX_BUILDER=ON"
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
];
nativeBuildInputs = with final; [
# Compiling and fetching dependencies
gcc
cmake
pkg-config
git # Not sure if it's needed
# For building icons
imagemagick
librsvg
];
buildInputs = with final; [
# Basic
fftwFloat
iniparser
# Input
alsa-lib
libpulseaudio
pipewire
portaudio
sndio
# Output
SDL2
wayland
wayland-protocols
wayland-utils
xorg.libX11
xorg.libXdmcp
xorg.libXfixes
xorg.libXrandr
# Graphics API
cairo
glew
# Misc
curl
dbus
expat # Might be a nixpkgs bug idfk
taglib
zlib
];
#outputs = [ "out" "lib" ];
#postInstall = ''
# moveToOutput "lib" "$lib"
#'';
CARGO_FEATURE_USE_SYSTEM_LIBS = "1";
};
};
packages =
forAllSystems (system: { inherit (nixpkgsFor.${system}) xava; });
defaultPackage = forAllSystems (system: self.packages.${system}.xava);
apps = forAllSystems (system: {
xava = {
type = "app";
program = "${self.packages.${system}.xava}/bin/xava";
};
});
defaultApp = forAllSystems (system: self.apps.${system}.xava);
devShell = forAllSystems (system:
nixpkgs.legacyPackages.${system}.mkShell {
inputsFrom = builtins.attrValues (packages.${system});
});
};
}