Skip to content
Closed
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 .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,10 @@ obj/

# End of https://www.toptal.com/developers/gitignore/api/qt,c++,clion,kotlin,python,android,pycharm,androidstudio,visualstudiocode,linux
linux/.qmlls.ini

# Nix
result
result-*

# direnv
.direnv
12 changes: 12 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url =
lock.nodes.${nodeName}.locked.url
or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
) { src = ./.; }).defaultNix
127 changes: 127 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
description = "AirPods liberated from Apple's ecosystem";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
treefmt-nix.url = "github:numtide/treefmt-nix";
};

outputs =
inputs@{ flake-parts, systems, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = import systems;
imports = [
inputs.treefmt-nix.flakeModule
];

perSystem =
{
pkgs,
...
}:
let
# Build time
nativeBuildInputs = with pkgs; [
cmake
pkg-config
qt6.wrapQtAppsHook
makeWrapper
];

# Run time
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtconnectivity
qt6.qtmultimedia
qt6.wrapQtAppsHook

openssl
bluez
libpulseaudio
];

librepods = pkgs.stdenv.mkDerivation {
pname = "librepods";
version = "dev";

src = ./linux;

inherit nativeBuildInputs;
inherit buildInputs;

meta = {
description = "AirPods liberated from Apple's ecosystem";
homepage = "https://github.com/kavishdevar/librepods";
license = pkgs.lib.licenses.gpl3Only;
maintainers = [ "kavishdevar" ];
platforms = pkgs.lib.platforms.unix;
mainProgram = "librepods";
};
};
in
{
packages = {
default = librepods;
inherit librepods;
};

devShells.default = pkgs.mkShell {
name = "librepods-dev";

buildInputs =
with pkgs;
[
gdb
]
++ buildInputs;
};

treefmt = {
programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler;
programs.nixfmt.package = pkgs.nixfmt-rfc-style;
};
};
};
}
12 changes: 12 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url =
lock.nodes.${nodeName}.locked.url
or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
) { src = ./.; }).shellNix