Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
Sam W | 6d1961cbbd | |
Sam W | 8230174631 | |
Nathan van Doorn | 26418cf627 | |
Nathan van Doorn | 8161d3e369 | |
Nathan van Doorn | 3f728a7c57 | |
Sam W | 1a12a03e95 | |
Nathan van Doorn | a763f7cd33 | |
Nathan van Doorn | a114003e54 | |
Nathan van Doorn | c8e82b3b4b | |
Nathan van Doorn | d44045b415 | |
Nathan van Doorn | 4490b28541 | |
Nathan van Doorn | 7f33c8843f |
53
flake.lock
53
flake.lock
|
@ -1,21 +1,5 @@
|
|||
{
|
||||
"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": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
|
@ -46,11 +30,44 @@
|
|||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"ntv2-gst-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1692893804,
|
||||
"narHash": "sha256-90TdrsnO5LatLD4dwivOnZG4tGJmNs2tdAsrL7eQF8g=",
|
||||
"owner": "aja-video",
|
||||
"repo": "ntv2-gst",
|
||||
"rev": "33d3a4957088e49ccecd9efa577b87bb0492f738",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "aja-video",
|
||||
"repo": "ntv2-gst",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ntv2-src": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"aja-ntv2": "aja-ntv2",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"ntv2-gst-src": "ntv2-gst-src",
|
||||
"ntv2-src": "ntv2-src"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
|
74
flake.nix
74
flake.nix
|
@ -1,7 +1,16 @@
|
|||
{
|
||||
description = "AJA video card software";
|
||||
inputs.aja-ntv2 = {
|
||||
url = "github:aja-video/ntv2";
|
||||
|
||||
inputs.ntv2-src = {
|
||||
type = "github";
|
||||
owner = "aja-video";
|
||||
repo = "ntv2";
|
||||
flake = false;
|
||||
};
|
||||
inputs.ntv2-gst-src = {
|
||||
type = "github";
|
||||
owner = "aja-video";
|
||||
repo = "ntv2-gst";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
|
@ -9,34 +18,47 @@
|
|||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
aja-ntv2,
|
||||
ntv2-src,
|
||||
ntv2-gst-src,
|
||||
}:
|
||||
(
|
||||
flake-utils.lib.eachSystem ["x86_64-linux"] (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in {
|
||||
packages.aja-ntv2-gst = pkgs.callPackage ./ntv2-gst.nix {
|
||||
ajantv2 = pkgs.callPackage ./aja-ntv2/default.nix {
|
||||
aja-src = aja-ntv2;
|
||||
buildApps = false;
|
||||
{
|
||||
overlays.default = final: prev: {
|
||||
ntv2 = final.callPackage ./ntv2 { inherit ntv2-src; };
|
||||
ntv2-gst = final.callPackage ./ntv2-gst { inherit ntv2-gst-src; };
|
||||
linuxPackages = prev.linuxPackages.extend
|
||||
(linuxFinal: linuxPrev: {
|
||||
ntv2-driver = linuxFinal.callPackage ./ntv2/driver.nix { inherit ntv2-src; };
|
||||
});
|
||||
};
|
||||
nixosModules.default = { config, lib, pkgs, ... }: {
|
||||
options = {
|
||||
ntv2 = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "If enabled, install the AJA driver, utilities, and gstreamer plugin.";
|
||||
};
|
||||
};
|
||||
})
|
||||
)
|
||||
// flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
in {
|
||||
formatter = pkgs.alejandra;
|
||||
})
|
||||
// {
|
||||
overlays.default = final: prev: {
|
||||
ajantv-utils = final.callPackage ./aja-ntv2/default.nix {aja-src = aja-ntv2;};
|
||||
ajantv-driver = final.linuxPackages.callPackage ./aja-ntv2/driver.nix {aja-src = aja-ntv2;};
|
||||
aja-ntv2-gst = self.packages.${prev.system}.aja-ntv2-gst;
|
||||
config = lib.mkIf config.ntv2.enable {
|
||||
# Apply the overlay to the system nixpkgs
|
||||
nixpkgs.overlays = [ self.overlays.default ];
|
||||
# Include the kernel module...
|
||||
boot.extraModulePackages = [ pkgs.linuxPackages.ntv2-driver ];
|
||||
# ...and load it automatically.
|
||||
boot.kernelModules = [ "ajantv2" ];
|
||||
# Include the utils and demos, and the gstreamer plugin
|
||||
environment.systemPackages = [ pkgs.ntv2 pkgs.ntv2-gst ];
|
||||
};
|
||||
};
|
||||
} // flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
|
||||
in {
|
||||
packages = {
|
||||
inherit (pkgs) ntv2 ntv2-gst;
|
||||
inherit (pkgs.linuxPackages) ntv2-driver;
|
||||
};
|
||||
formatter = pkgs.alejandra;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2023 Sam Willcocks <sam@wlcx.cc>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
27
ntv2-gst.nix
27
ntv2-gst.nix
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
autoconf,
|
||||
automake,
|
||||
pkgconfig,
|
||||
libtool,
|
||||
gst_all_1,
|
||||
ajantv2,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "aja-ntv2-gst";
|
||||
src = fetchFromGitHub {
|
||||
owner = "aja-video";
|
||||
repo = "ntv2-gst";
|
||||
rev = "refs/heads/master";
|
||||
hash = "sha256-90TdrsnO5LatLD4dwivOnZG4tGJmNs2tdAsrL7eQF8g=";
|
||||
};
|
||||
sourceRoot = "source/gst-plugin";
|
||||
patches = [./no.patch];
|
||||
|
||||
nativeBuildInputs = [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ajantv2];
|
||||
GST_NTV2 = "${ajantv2}/include";
|
||||
preConfigure = ''
|
||||
./autogen.sh
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
stdenv,
|
||||
ntv2-gst-src,
|
||||
autoconf,
|
||||
automake,
|
||||
pkg-config,
|
||||
libtool,
|
||||
gst_all_1,
|
||||
ntv2,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "ntv2-gst";
|
||||
src = ntv2-gst-src;
|
||||
sourceRoot = "source/gst-plugin";
|
||||
patches = [./no.patch];
|
||||
|
||||
nativeBuildInputs = [autoconf automake pkg-config libtool gst_all_1.gst-plugins-base ntv2];
|
||||
GST_NTV2 = "${ntv2}/include";
|
||||
preConfigure = ''
|
||||
./autogen.sh
|
||||
'';
|
||||
}
|
|
@ -2,12 +2,12 @@
|
|||
stdenv,
|
||||
lib,
|
||||
cmake,
|
||||
aja-src,
|
||||
ntv2-src,
|
||||
buildApps ? true,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "ajantv2-dev";
|
||||
src = aja-src;
|
||||
name = "ntv2";
|
||||
src = ntv2-src;
|
||||
nativeBuildInputs = [cmake];
|
||||
|
||||
cmakeFlags =
|
|
@ -2,11 +2,11 @@
|
|||
stdenv,
|
||||
nukeReferences,
|
||||
kernel,
|
||||
aja-src,
|
||||
ntv2-src,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "ajantv2-driver-${kernel.version}";
|
||||
src = aja-src;
|
||||
name = "ntv2-driver-${kernel.version}";
|
||||
src = ntv2-src;
|
||||
patches = [./lol.patch ./newkernels.patch];
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
buildInputs = [nukeReferences];
|
24
readme.md
24
readme.md
|
@ -7,20 +7,22 @@ gstreamer plugin. This allows you to use Aja video IO cards on NixOS.
|
|||
## Usage
|
||||
|
||||
- Add the flake to your system flake's inputs.
|
||||
- Apply the overlay to your system's nixpkgs, e.g.
|
||||
- Include the nixos module in your config:
|
||||
```nix
|
||||
nixpkgs.overlays = [ ajantv2.overlays.default ];
|
||||
...
|
||||
nixosConfigurations = {
|
||||
mymachine = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
# ... your other modules ...
|
||||
ajantv2.nixosModules.default
|
||||
];
|
||||
};
|
||||
...
|
||||
```
|
||||
- Add the kernel driver:
|
||||
- Enable the module by adding the following to your system config:
|
||||
```nix
|
||||
# Include the kernel module
|
||||
boot.extraModulePackages = [pkgs.ajantv-driver];
|
||||
# And load it automatically
|
||||
boot.kernelModules = [ "ajantv2" ];
|
||||
```
|
||||
- Include the utils/demos and gstreamer plugin:
|
||||
```nix
|
||||
environment.systemPackages = [pkgs.ajantv-utils pkgs.aja-ntv2-gst]
|
||||
ntv2.enable = true;
|
||||
```
|
||||
|
||||
## Gstreamer
|
||||
|
|
Loading…
Reference in New Issue