Merge pull request #4 from streams-r-us/nixos-module
Add a NixOS module!
This commit is contained in:
commit
26418cf627
21
flake.nix
21
flake.nix
|
@ -30,6 +30,27 @@
|
||||||
ntv2-driver = linuxFinal.callPackage ./ntv2/driver.nix { inherit ntv2-src; };
|
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.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
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:
|
} // flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
|
pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; };
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
ntv2-gst-src,
|
ntv2-gst-src,
|
||||||
autoconf,
|
autoconf,
|
||||||
automake,
|
automake,
|
||||||
pkgconfig,
|
pkg-config,
|
||||||
libtool,
|
libtool,
|
||||||
gst_all_1,
|
gst_all_1,
|
||||||
ntv2,
|
ntv2,
|
||||||
|
@ -14,7 +14,7 @@ stdenv.mkDerivation {
|
||||||
sourceRoot = "source/gst-plugin";
|
sourceRoot = "source/gst-plugin";
|
||||||
patches = [./no.patch];
|
patches = [./no.patch];
|
||||||
|
|
||||||
nativeBuildInputs = [autoconf automake pkgconfig libtool gst_all_1.gst-plugins-base ntv2];
|
nativeBuildInputs = [autoconf automake pkg-config libtool gst_all_1.gst-plugins-base ntv2];
|
||||||
GST_NTV2 = "${ntv2}/include";
|
GST_NTV2 = "${ntv2}/include";
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
|
|
15
readme.md
15
readme.md
|
@ -7,20 +7,9 @@ gstreamer plugin. This allows you to use Aja video IO cards on NixOS.
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
- Add the flake to your system flake's inputs.
|
- Add the flake to your system flake's inputs.
|
||||||
- Apply the overlay to your system's nixpkgs, e.g.
|
- Enable the module by adding the following to your system config:
|
||||||
```nix
|
```nix
|
||||||
nixpkgs.overlays = [ ajantv2.overlays.default ];
|
ntv2.enable = true;
|
||||||
```
|
|
||||||
- Add the kernel driver:
|
|
||||||
```nix
|
|
||||||
# Include the kernel module
|
|
||||||
boot.extraModulePackages = [pkgs.linuxPackages.ntv2-driver];
|
|
||||||
# And load it automatically
|
|
||||||
boot.kernelModules = [ "ajantv2" ];
|
|
||||||
```
|
|
||||||
- Include the utils/demos and gstreamer plugin:
|
|
||||||
```nix
|
|
||||||
environment.systemPackages = [pkgs.ntv2 pkgs.ntv2-gst]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Gstreamer
|
## Gstreamer
|
||||||
|
|
Loading…
Reference in New Issue