nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 69 lines 2.4 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 rustPlatform, 5 nix-update-script, 6 polaris-web, 7 nixosTests, 8}: 9 10rustPlatform.buildRustPackage rec { 11 pname = "polaris"; 12 version = "0.14.3"; 13 14 src = fetchFromGitHub { 15 owner = "agersant"; 16 repo = "polaris"; 17 rev = version; 18 hash = "sha256-2GHYIlEzRS7KXahdrxMjyIcPCNw8gXJw5/4ZpB/zT3Y="; 19 20 # The polaris version upstream in Cargo.lock is "0.0.0". 21 # We're unable to simply patch it in the patch phase due to 22 # rustPlatform.buildRustPackage fetching dependencies before applying patches. 23 # If we patch it after fetching dependencies we get an error when 24 # validating consistency between the final build and the prefetched deps. 25 postFetch = '' 26 # 'substituteInPlace' does not support multiline replacements? 27 sed -i $out/Cargo.lock -z \ 28 -e 's/\[\[package\]\]\nname = "polaris"\nversion = "0.0.0"/[[package]]\nname = "polaris"\nversion = "'"${version}"'"/g' 29 ''; 30 }; 31 32 cargoHash = "sha256-bVXz/rSfkmdQlAa3B4zamZebpRBOkch6zNOFiyEQBbY="; 33 34 # Compile-time environment variables for where to find assets needed at runtime 35 env = { 36 POLARIS_WEB_DIR = "${polaris-web}/share/polaris-web"; 37 POLARIS_SWAGGER_DIR = "${placeholder "out"}/share/polaris-swagger"; 38 }; 39 40 postInstall = '' 41 mkdir -p $out/share 42 cp -a docs/swagger $out/share/polaris-swagger 43 ''; 44 45 preCheck = '' 46 # 'Err' value: Os { code: 24, kind: Uncategorized, message: "Too many open files" } 47 ulimit -n 4096 48 ''; 49 50 __darwinAllowLocalNetworking = true; 51 52 passthru.tests = nixosTests.polaris; 53 passthru.updateScript = nix-update-script { }; 54 55 meta = { 56 description = "Self-host your music collection, and access it from any computer and mobile device"; 57 longDescription = '' 58 Polaris is a FOSS music streaming application, designed to let you enjoy your music collection 59 from any computer or mobile device. Polaris works by streaming your music directly from your 60 own computer, without uploading it to a third-party. There are no kind of premium version. 61 The only requirement is that your computer stays on while it streams your music! 62 ''; 63 homepage = "https://github.com/agersant/polaris"; 64 license = lib.licenses.mit; 65 maintainers = with lib.maintainers; [ pbsds ]; 66 platforms = lib.platforms.unix; 67 mainProgram = "polaris"; 68 }; 69}