From a56669ed5e3d4fac88fa033330e23271674c591a Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Fri, 18 Oct 2024 15:20:43 +0000 Subject: [PATCH] feat: add pd-mapper --- configuration.nix | 32 ++++++++++++++++++++++++++++++++ pkgs/pd-mapper.nix | 33 +++++++++++++++++++++++++++++++++ pkgs/qmic.nix | 26 ++++++++++++++++++++++++++ pkgs/qrtr.nix | 33 +++++++++++++++++++++++++++++++++ pkgs/rmtfs.nix | 31 +++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 pkgs/pd-mapper.nix create mode 100644 pkgs/qmic.nix create mode 100644 pkgs/qrtr.nix create mode 100644 pkgs/rmtfs.nix diff --git a/configuration.nix b/configuration.nix index 57308a1..3b1db4b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -48,6 +48,38 @@ services.getty.autologinUser = lib.mkDefault "root"; + nixpkgs.overlays = [ + (final: prev: { + qrtr = prev.callPackage ./pkgs/qrtr.nix {}; + qmic = prev.callPackage ./pkgs/qmic.nix {}; + rmtfs = prev.callPackage ./pkgs/rmtfs.nix { inherit (final) qrtr qmic; }; + pd-mapper = final.callPackage ./pkgs/pd-mapper.nix { inherit (final) qrtr; }; + }) + ]; + + systemd.services = { + pd-mapper = { + unitConfig = { + Requires = "qrtr-ns.service"; + After = "qrtr-ns.service"; + }; + serviceConfig = { + Restart = "always"; + ExecStart = "${pkgs.pd-mapper}/bin/pd-mapper"; + }; + wantedBy = [ + "multi-user.target" + ]; + }; + qrtr-ns = { + serviceConfig = { + ExecStart = "${pkgs.qrtr}/bin/qrtr-ns -v -f 1"; + Restart = "always"; + }; + wantedBy = ["multi-user.target"]; + }; + }; + nixpkgs.config.allowUnfree = true; nix.settings = { diff --git a/pkgs/pd-mapper.nix b/pkgs/pd-mapper.nix new file mode 100644 index 0000000..c013996 --- /dev/null +++ b/pkgs/pd-mapper.nix @@ -0,0 +1,33 @@ +{ + stdenv, + lib, + fetchFromGitHub, + pkg-config, + qrtr, + lzma, +}: + +stdenv.mkDerivation { + pname = "pd-mapper"; + version = "2024-06-19"; + + src = fetchFromGitHub { + owner = "linux-msm"; + repo = "pd-mapper"; + rev = "e7c42e1522249593302a5b8920b9e7b42dc3f25e"; + sha256 = "sha256-gTUpltbY5439IEEvnxnt8WOFUgfpQUJWr5f+OB12W8A="; + }; + + nativeBuildInputs = [ pkg-config lzma ]; + + buildInputs = [ qrtr ]; + + installFlags = [ "prefix=$(out)" ]; + + meta = with lib; { + description = "pd mapper"; + homepage = "https://github.com/linux-msm/pd-mapper"; + license = licenses.bsd3; + platforms = platforms.linux; + }; +} diff --git a/pkgs/qmic.nix b/pkgs/qmic.nix new file mode 100644 index 0000000..eb6fcf6 --- /dev/null +++ b/pkgs/qmic.nix @@ -0,0 +1,26 @@ +{ + stdenv, + lib, + fetchFromGitHub +}: + +stdenv.mkDerivation { + pname = "qmic"; + version = "2022-07-18"; + + src = fetchFromGitHub { + owner = "linux-msm"; + repo = "qmic"; + rev = "4574736afce75aa5eec1e1069a19563410167c9f"; + sha256 = "sha256-0/mIg98pN66ZaVsQ6KmZINuNfiKvdEHMsqDx0iciF8w="; + }; + + installFlags = [ "prefix=$(out)" ]; + + meta = with lib; { + description = "QMI IDL compiler"; + homepage = "https://github.com/linux-msm/qmic"; + license = licenses.bsd3; + platforms = platforms.aarch64; + }; +} diff --git a/pkgs/qrtr.nix b/pkgs/qrtr.nix new file mode 100644 index 0000000..a8f1733 --- /dev/null +++ b/pkgs/qrtr.nix @@ -0,0 +1,33 @@ +{ + stdenv, + lib, + fetchFromGitHub, + meson, + cmake, + pkg-config, + systemd, + ninja, +}: + +stdenv.mkDerivation { + pname = "qrtr"; + version = "2024-05-21"; + + src = fetchFromGitHub { + owner = "linux-msm"; + repo = "qrtr"; + rev = "daf7f4cc326a5036dcce2bd7deaf2c32841b0336"; + hash = "sha256-OGx5fxxtrNN9EJJxxH4MTDRFGsyu4LNo+ks46zbJqF0="; + }; + + nativeBuildInputs = [ meson cmake pkg-config systemd ninja ]; + + installFlags = [ "prefix=$(out)" ]; + + meta = with lib; { + description = "QMI IDL compiler"; + homepage = "https://github.com/linux-msm/qrtr"; + license = licenses.bsd3; + platforms = platforms.aarch64; + }; +} diff --git a/pkgs/rmtfs.nix b/pkgs/rmtfs.nix new file mode 100644 index 0000000..0b2087f --- /dev/null +++ b/pkgs/rmtfs.nix @@ -0,0 +1,31 @@ +{ + lib, + stdenv, + fetchFromGitHub, + udev, + qrtr, + qmic +}: + +stdenv.mkDerivation { + pname = "rmtfs"; + version = "2024-03-18"; + + buildInputs = [ udev qrtr qmic ]; + + src = fetchFromGitHub { + owner = "linux-msm"; + repo = "rmtfs"; + rev = "33e1e40615efc59b17a515afe857c51b8b8c1ad1"; + hash = "sha256-AxFuDmfLTcnnwm+nezwLc8yaHcX+pFkX5qSIO38T/BM="; + }; + + installFlags = [ "prefix=$(out)" ]; + + meta = with lib; { + description = "Qualcomm Remote Filesystem Service"; + homepage = "https://github.com/linux-msm/rmtfs"; + license = licenses.bsd3; + platforms = platforms.aarch64; + }; +}