Move ntv2 src to a flake input

This commit is contained in:
Sam W 2023-10-13 20:56:15 +01:00
parent 2cbc0594f6
commit 9e1beef1c8
5 changed files with 46 additions and 21 deletions

View File

@ -1,13 +1,13 @@
{ {
stdenv, stdenv,
callPackage,
lib, lib,
cmake, cmake,
aja-src,
buildApps ? true, buildApps ? true,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ajantv2-dev"; name = "ajantv2-dev";
src = callPackage ./src.nix {}; src = aja-src;
nativeBuildInputs = [cmake]; nativeBuildInputs = [cmake];
cmakeFlags = cmakeFlags =

View File

@ -1,12 +1,12 @@
{ {
callPackage,
stdenv, stdenv,
nukeReferences, nukeReferences,
kernel, kernel,
aja-src,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ajantv2-driver-${kernel.version}"; name = "ajantv2-driver-${kernel.version}";
src = callPackage ./src.nix {}; src = aja-src;
patches = [./lol.patch ./newkernels.patch]; patches = [./lol.patch ./newkernels.patch];
nativeBuildInputs = kernel.moduleBuildDependencies; nativeBuildInputs = kernel.moduleBuildDependencies;
buildInputs = [nukeReferences]; buildInputs = [nukeReferences];

View File

@ -1,8 +0,0 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "aja-video";
repo = "ntv2";
rev = "refs/heads/main";
hash = "sha256-rXjKDhQcZwAxsMjCoL21gpWeLWyIXyK/1y+78mhKgeo=";
}

View File

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"aja-ntv2": {
"flake": false,
"locked": {
"lastModified": 1662565853,
"narHash": "sha256-rXjKDhQcZwAxsMjCoL21gpWeLWyIXyK/1y+78mhKgeo=",
"owner": "aja-video",
"repo": "ntv2",
"rev": "3a1e91f740e36e43a1ec74ff446a097330e87220",
"type": "github"
},
"original": {
"owner": "aja-video",
"repo": "ntv2",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -32,6 +48,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"aja-ntv2": "aja-ntv2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }

View File

@ -1,25 +1,41 @@
{ {
description = "AJA video card software"; description = "AJA video card software";
inputs.aja-ntv2 = {
url = "github:aja-video/ntv2";
flake = false;
};
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
flake-utils, flake-utils,
}: ( aja-ntv2,
}:
(
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
in { in {
packages.aja-ntv2-gst = pkgs.callPackage ./ntv2-gst.nix { packages.aja-ntv2-gst = pkgs.callPackage ./ntv2-gst.nix {
ajantv2 = pkgs.callPackage ./aja-ntv2/default.nix { buildApps = false; }; ajantv2 = pkgs.callPackage ./aja-ntv2/default.nix {
aja-src = aja-ntv2;
buildApps = false;
}; };
};
})
)
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
}) })
) // { // {
overlays.default = final: prev: { overlays.default = final: prev: {
ajantv-utils = final.callPackage ./aja-ntv2/default.nix {}; ajantv-utils = final.callPackage ./aja-ntv2/default.nix {aja-src = aja-ntv2;};
ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {}; ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {aja-src = aja-ntv2;};
aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst; aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst;
}; };
}; };