diff --git a/flake.nix b/flake.nix index f8ded1e..dbe74f4 100644 --- a/flake.nix +++ b/flake.nix @@ -114,7 +114,16 @@ checks.formatting = treefmtEval.config.build.check inputs.self; # nix {run,shell,build} - legacyPackages = import ./pkgs pkgs; + # NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, + # only keeping some packages that only fits for personal use. + legacyPackages = + pkgs.lib.packagesFromDirectoryRecursive { + inherit (pkgs) callPackage; + directory = ./pkgs; + } + // { + background = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; + }; # nix develop devShells.default = pkgs.mkShellNoCC { diff --git a/home/default.nix b/home/default.nix index 7cb1751..ef30aa8 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, ... }: +{ + lib, + inputs, + pkgs, + ... +}: { home = { username = "guanranwang"; @@ -25,24 +30,27 @@ udiskie.enable = true; }; - home.packages = with pkgs; [ - dconf-editor - fastfetch - fd - file-roller - fractal - gnome-calculator - hyperfine - libnotify - loupe - pwvucontrol - seahorse - wl-clipboard + home.packages = + (with pkgs; [ + dconf-editor + fastfetch + fd + file-roller + fractal + gnome-calculator + hyperfine + libnotify + loupe + pwvucontrol + seahorse + wl-clipboard - mumble - osu-lazer-bin - prismlauncher - ]; + osu-lazer-bin + prismlauncher + ]) + ++ (with inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}; [ + mumble-git + ]); home.sessionVariables = { # https://github.com/ppy/osu-framework/pull/6292 diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 51ed0ea..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -# NOTE: 301: All packages are migrated to `github:Guanran928/nur-packages`, -# only keeping some packages that only fits for personal use. -pkgs: { background = pkgs.nixos-artwork.wallpapers.nineish-dark-gray.src; } diff --git a/pkgs/mumble-git/package.nix b/pkgs/mumble-git/package.nix new file mode 100644 index 0000000..06b40b0 --- /dev/null +++ b/pkgs/mumble-git/package.nix @@ -0,0 +1,118 @@ +{ + lib, + alsa-lib, + avahi-compat, + boost, + cmake, + fetchFromGitHub, + flac, + libjack2, + libogg, + libopus, + libpulseaudio, + libsndfile, + libvorbis, + nixosTests, + pipewire, + pkg-config, + poco, + protobuf, + python3, + qt6, + rnnoise, + speechd, + speex, + stdenv, + jackSupport ? false, + pipewireSupport ? true, + pulseSupport ? true, + speechdSupport ? false, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "mumble"; + version = "1.5.634-unstable-2024-10-05"; + + src = fetchFromGitHub { + owner = "mumble-voip"; + repo = "mumble"; + rev = "cb01bfa5200fce53db68b769d05995c999e7cdd8"; + hash = "sha256-Tf029ae+PfFPhchU45y96IJVeY9GPzWD2E+NprI/ZYk="; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ + cmake + pkg-config + python3 + qt6.wrapQtAppsHook + qt6.qttools + ]; + + buildInputs = + [ + avahi-compat + boost + flac + libogg + libopus + libsndfile + libvorbis + poco + protobuf + qt6.qtsvg + rnnoise + speex + ] + ++ lib.optional (!jackSupport) alsa-lib + ++ lib.optional jackSupport libjack2 + ++ lib.optional speechdSupport speechd + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional pipewireSupport pipewire; + + env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd}/include/speech-dispatcher"; + + cmakeFlags = + [ + "-D g15=OFF" + "-D server=OFF" + "-D bundled-celt=ON" + "-D bundled-opus=OFF" + "-D bundled-speex=OFF" + "-D bundle-qt-translations=OFF" + "-D update=OFF" + "-D overlay-xcompile=OFF" + "-D oss=OFF" + "-D warnings-as-errors=OFF" # conversion error workaround + ] + ++ lib.optional (!speechdSupport) "-D speechd=OFF" + ++ lib.optional (!pulseSupport) "-D pulseaudio=OFF" + ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" + ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; + + preConfigure = '' + patchShebangs scripts + ''; + + postFixup = '' + wrapProgram $out/bin/mumble \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath ( + lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire + ) + }" + ''; + + passthru.tests.connectivity = nixosTests.mumble; + + meta = { + description = "Low-latency, high quality voice chat software"; + homepage = "https://mumble.info"; + license = lib.licenses.bsd3; + mainProgram = "mumble"; + maintainers = with lib.maintainers; [ + felixsinger + lilacious + ]; + platforms = lib.platforms.linux; + }; +})