11 rustPlatform.buildRustPackage rec {
15 src = fetchFromGitHub {
19 hash = "sha256-2GHYIlEzRS7KXahdrxMjyIcPCNw8gXJw5/4ZpB/zT3Y=";
21 # The polaris version upstream in Cargo.lock is "0.0.0".
22 # We're unable to simply patch it in the patch phase due to
23 # rustPlatform.buildRustPackage fetching dependencies before applying patches.
24 # If we patch it after fetching dependencies we get an error when
25 # validating consistency between the final build and the prefetched deps.
27 # 'substituteInPlace' does not support multiline replacements?
28 sed -i $out/Cargo.lock -z \
29 -e 's/\[\[package\]\]\nname = "polaris"\nversion = "0.0.0"/[[package]]\nname = "polaris"\nversion = "'"${version}"'"/g'
33 cargoHash = if stdenv.buildPlatform.isDarwin
34 then "sha256-HTqsghjfSjwOaN/ApPFvWVEoquZzE3MYzULkhUOXIWI"
35 else "sha256-Z3AbYtdNAyKT5EuGtCktEg0fxs/gpKdsrttRkxZhLAU";
37 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
41 # Compile-time environment variables for where to find assets needed at runtime
43 POLARIS_WEB_DIR = "${polaris-web}/share/polaris-web";
44 POLARIS_SWAGGER_DIR = "${placeholder "out"}/share/polaris-swagger";
49 cp -a docs/swagger $out/share/polaris-swagger
53 # 'Err' value: Os { code: 24, kind: Uncategorized, message: "Too many open files" }
57 __darwinAllowLocalNetworking = true;
59 passthru.tests = nixosTests.polaris;
60 passthru.updateScript = nix-update-script { };
63 description = "Self-host your music collection, and access it from any computer and mobile device";
65 Polaris is a FOSS music streaming application, designed to let you enjoy your music collection
66 from any computer or mobile device. Polaris works by streaming your music directly from your
67 own computer, without uploading it to a third-party. There are no kind of premium version.
68 The only requirement is that your computer stays on while it streams your music!
70 homepage = "https://github.com/agersant/polaris";
71 license = licenses.mit;
72 maintainers = with maintainers; [ pbsds ];
73 platforms = platforms.unix;
74 mainProgram = "polaris";