From 2851d85d3da96b216ed9ed407728e38d997ed1fc Mon Sep 17 00:00:00 2001 From: Nathan van Doorn Date: Fri, 13 Oct 2023 19:02:39 +0200 Subject: [PATCH 1/4] Use callPackage machinery for dependency resolution a bit more --- aja-ntv2/default.nix | 4 ++-- aja-ntv2/src.nix | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aja-ntv2/default.nix b/aja-ntv2/default.nix index 1df23a8..76c3ed2 100644 --- a/aja-ntv2/default.nix +++ b/aja-ntv2/default.nix @@ -2,13 +2,13 @@ stdenv, callPackage, lib, - pkgs, + cmake, buildApps ? true, }: stdenv.mkDerivation { name = "ajantv2-dev"; src = callPackage ./src.nix {}; - nativeBuildInputs = [pkgs.cmake]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ diff --git a/aja-ntv2/src.nix b/aja-ntv2/src.nix index 41abe02..be8a7de 100644 --- a/aja-ntv2/src.nix +++ b/aja-ntv2/src.nix @@ -1,4 +1,6 @@ -{ pkgs }: pkgs.fetchFromGitHub { +{ fetchFromGitHub }: + +fetchFromGitHub { owner = "aja-video"; repo = "ntv2"; rev = "refs/heads/main"; From c82334aae1cd944ea2dfc7760a2fba53c9b982ab Mon Sep 17 00:00:00 2001 From: Nathan van Doorn Date: Fri, 13 Oct 2023 19:03:00 +0200 Subject: [PATCH 2/4] Notice that flake-utils is in the flakes registry --- flake.lock | 39 +++++++++++++++++++-------------------- flake.nix | 5 ++--- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 88e88e5..8a5b4ad 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, "nixpkgs": { "locked": { "lastModified": 1694499547, @@ -15,8 +32,8 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" } }, "systems": { @@ -33,24 +50,6 @@ "repo": "default", "type": "github" } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 080e53d..93babf1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,12 @@ { description = "AJA video card software"; - inputs.utils.url = "github:numtide/flake-utils"; outputs = { self, nixpkgs, - utils, + flake-utils, }: ( - utils.lib.eachSystem ["x86_64-linux"] (system: let + flake-utils.lib.eachSystem ["x86_64-linux"] (system: let pkgs = import nixpkgs { inherit system; }; From 2b2d63f1c526270cfff6be3bf162f8ed7d22ff0a Mon Sep 17 00:00:00 2001 From: Nathan van Doorn Date: Fri, 13 Oct 2023 19:04:54 +0200 Subject: [PATCH 3/4] Remove unnessasary parens --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 93babf1..cc9dd51 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,10 @@ formatter = pkgs.alejandra; }) ) // { - overlays.default = (final: prev: { + overlays.default = final: prev: { ajantv-utils = final.callPackage ./aja-ntv2/default.nix {}; ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {}; aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst; - }); + }; }; } From ecaa46a18b9aadafcd2ae21498047e459fa74807 Mon Sep 17 00:00:00 2001 From: Nathan van Doorn Date: Fri, 13 Oct 2023 19:28:06 +0200 Subject: [PATCH 4/4] use callPackage for deps in another place too --- ntv2-gst.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ntv2-gst.nix b/ntv2-gst.nix index c3239d3..8e76543 100644 --- a/ntv2-gst.nix +++ b/ntv2-gst.nix @@ -1,7 +1,11 @@ { stdenv, - pkgs, fetchFromGitHub, + autoconf, + automake, + pkgconfig, + libtool, + gst_all_1, ajantv2, }: stdenv.mkDerivation { @@ -15,7 +19,7 @@ stdenv.mkDerivation { sourceRoot = "source/gst-plugin"; patches = [./no.patch]; - nativeBuildInputs = with pkgs; [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ajantv2]; + nativeBuildInputs = [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ajantv2]; GST_NTV2 = "${ajantv2}/include"; preConfigure = '' ./autogen.sh