Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
./programs/lazygit.nix
./programs/less.nix
./programs/liboping.nix
./programs/librepods.nix
./programs/light.nix
./programs/localsend.nix
./programs/mdevctl.nix
Expand Down
38 changes: 38 additions & 0 deletions nixos/modules/programs/librepods.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.librepods;
in
{
options = {
programs.librepods = {
enable = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Whether to configure system to enable librepods.
To grant access to a user, it must be part of librepods group:
`users.users.alice.extraGroups = ["librepods"];`
'';
};
};
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ librepods ];
users.groups.librepods = { };

security.wrappers.librepods = {
source = lib.getExe pkgs.librepods;
capabilities = "cap_net_admin+ep";
owner = "root";
group = "librepods";
};
};

meta.maintainers = [ lib.maintainers.Cameo007 ];
}
48 changes: 48 additions & 0 deletions pkgs/by-name/li/librepods/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
qt6,
pulseaudio,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "librepods";
version = "0.2.0-alpha";

src = fetchFromGitHub {
owner = "kavishdevar";
repo = "librepods";
tag = "v${finalAttrs.version}";
hash = "sha256-pD/Jb/wV91RlsiGl3SnGvQ11GNX37Y//CQHpIRyM/58=";
};

nativeBuildInputs = [
cmake
qt6.wrapQtAppsHook
];

buildInputs = [
qt6.qtbase
qt6.qtconnectivity
qt6.qtmultimedia
];

sourceRoot = "${finalAttrs.src.name}/linux";

postPatch = ''
substituteInPlace autostartmanager.hpp --replace-fail "QString appPath = QCoreApplication::applicationFilePath();" "QString appPath = \"$out/bin/librepods\";"
'';

qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ pulseaudio ]}'' ];

meta = {
description = "AirPods libreated from Apple’s ecosystem";
homepage = "https://github.com/kavishdevar/librepods";
changelog = "https://github.com/kavishdevar/librepods/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ Cameo007 ];
mainProgram = "librepods";
platforms = lib.platforms.linux;
};
})
Loading