diff --git a/README.md b/README.md index 077cfbc..27035b3 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,47 @@ -# nur-packages-template - -**A template for [NUR](https://github.com/nix-community/NUR) repositories** - -## Setup - -1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.) -2. Add your packages to the [pkgs](./pkgs) directory and to - [default.nix](./default.nix) - * Remember to mark the broken packages as `broken = true;` in the `meta` - attribute, or travis (and consequently caching) will fail! - * Library functions, modules and overlays go in the respective directories -3. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com). - - Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer - to a random value as described in the file - - Travis ci: Change your NUR repo name and optionally your cachix repo name in - [.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh -5. Change your travis and cachix names on the README template section and delete - the rest -6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository) - -## README template - # nur-packages -**My personal [NUR](https://github.com/nix-community/NUR) repository** +Personal [NUR](https://github.com/nix-community/NUR) repository. - -![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) +## Packages - -[![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) +## Usage + +See the official NUR installation docs: [NUR documentation – Installation](https://nur.nix-community.org/documentation/#installation). + +### Usage (flakes) + +If you want to use this repo directly as a flake input: + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + my-nur.url = "github:/nur-packages"; + }; + + outputs = { self, nixpkgs, my-nur, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + overlays = [ my-nur.overlays.default ]; + }; + in + { + packages.${system}.default = pkgs.librepods; + }; +} +``` + +### Usage (local build/test) + +From this repository: + +```bash +nix build .#librepods +./result/bin/librepods +``` diff --git a/default.nix b/default.nix index 3846c24..4c55c62 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,8 @@ modules = import ./modules; # NixOS modules overlays = import ./overlays; # nixpkgs overlays - example-package = pkgs.callPackage ./pkgs/example-package { }; + # example-package = pkgs.callPackage ./pkgs/example-package { }; + librepods = pkgs.callPackage ./pkgs/librepods { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } diff --git a/pkgs/librepods/default.nix b/pkgs/librepods/default.nix new file mode 100644 index 0000000..a1022ad --- /dev/null +++ b/pkgs/librepods/default.nix @@ -0,0 +1,54 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, qt6Packages +, openssl +, pulseaudio +}: + +stdenv.mkDerivation rec { + pname = "librepods"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "kavishdevar"; + repo = "librepods"; + rev = "linux-v${version}"; + hash = "sha256-ZvHbSSW0rfcsNUORZURe0oBHQbnqmS5XT9ffVMwjIMU="; + }; + + sourceRoot = "${src.name}/linux"; + + nativeBuildInputs = [ + cmake + pkg-config + qt6Packages.wrapQtAppsHook + ]; + + buildInputs = [ + openssl + pulseaudio + + qt6Packages.qtbase + qt6Packages.qtconnectivity + qt6Packages.qtdeclarative + qt6Packages.qtwayland + qt6Packages.qttools + ]; + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + ]; + + meta = { + description = "AirPods liberated from Apple's ecosystem (LibrePods Linux app)"; + homepage = "https://github.com/kavishdevar/librepods"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.linux; + mainProgram = "librepods"; + }; +} + +