From fd5a9329157e679c9e66ac490320df1840076e4b Mon Sep 17 00:00:00 2001 From: demenik Date: Sun, 5 Oct 2025 13:08:07 +0200 Subject: [PATCH] Added flake.nix for NixOS support --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..c4b0560d --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1759381078, + "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..d6f31e9a --- /dev/null +++ b/flake.nix @@ -0,0 +1,65 @@ +{ + description = "Nixpkg for LibrePods"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in { + packages.default = pkgs.stdenv.mkDerivation { + pname = "librepods"; + version = "0.1.0"; + + src = ./linux; + + nativeBuildInputs = with pkgs; [ + cmake + pkg-config + qt6.wrapQtAppsHook + makeWrapper + ]; + + buildInputs = with pkgs; [ + qt6.qtbase + qt6.qtdeclarative + qt6.qtsvg + qt6.qtconnectivity + qt6.qtmultimedia + qt6Packages.qtstyleplugin-kvantum + + openssl + bluez + libpulseaudio + ]; + + postInstall = '' + wrapProgram $out/bin/librepods \ + --unset QT_STYLE_OVERRIDE + ''; + + meta = with pkgs.lib; { + description = "A cross-platform app to manage AirPods on Linux and Android."; + homepage = "https://github.com/kavishdevar/librepods"; + license = licenses.agpl3Only; + maintainers = []; + platforms = platforms.linux; + }; + }; + + apps.default = flake-utils.lib.mkApp { + drv = self.packages.${system}.default; + }; + + devShells.default = pkgs.mkShell { + inputsFrom = [self.packages.${system}.default]; + }; + }); +}