From e15d9b79beedad2e77ad1f265c766e61a6cd6681 Mon Sep 17 00:00:00 2001 From: Soramane <61896496+soramanew@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:12:27 +1000 Subject: feat: add nix flake --- default.nix | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 default.nix (limited to 'default.nix') diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..9f440be --- /dev/null +++ b/default.nix @@ -0,0 +1,84 @@ +{ + rev, + lib, + stdenv, + makeWrapper, + makeFontsConf, + fish, + ddcutil, + brightnessctl, + app2unit, + cava, + networkmanager, + lm_sensors, + grim, + swappy, + wl-clipboard, + libqalculate, + inotify-tools, + bluez, + bash, + hyprland, + material-symbols, + gcc, + quickshell, + aubio, + pipewire, +}: let + runtimeDeps = [ + fish + ddcutil + brightnessctl + app2unit + cava + networkmanager + lm_sensors + grim + swappy + wl-clipboard + libqalculate + inotify-tools + bluez + bash + hyprland + ]; + fontconfig = makeFontsConf { + fontDirectories = [material-symbols]; + }; +in + stdenv.mkDerivation { + pname = "caelestia-shell"; + version = "${rev}"; + src = ./.; + + nativeBuildInputs = [gcc makeWrapper]; + buildInputs = [quickshell aubio pipewire]; + propogatedBuildInputs = runtimeDeps; + + buildPhase = '' + mkdir -p bin + g++ -std=c++17 -Wall -Wextra \ + -I${pipewire.dev}/include/pipewire-0.3 \ + -I${pipewire.dev}/include/spa-0.2 \ + -I${aubio}/include/aubio \ + assets/beat_detector.cpp \ + -o bin/beat_detector \ + -lpipewire-0.3 -laubio + ''; + + installPhase = '' + install -Dm755 bin/beat_detector $out/bin/beat_detector + makeWrapper ${quickshell}/bin/qs $out/bin/caelestia-shell \ + --prefix PATH : "${lib.makeBinPath runtimeDeps}" \ + --set FONTCONFIG_FILE "${fontconfig}" \ + --set CAELESTIA_BD_PATH $out/bin/beat_detector \ + --add-flags '-p ${./.}' + ''; + + meta = { + description = "A very segsy desktop shell"; + homepage = "https://github.com/caelestia-dots/shell"; + license = lib.licenses.gpl3Only; + mainProgram = "caelestia-shell"; + }; + } -- cgit v1.2.3-freya