Skip to content

Commit

Permalink
indi-full: refactor 3rdparty drivers
Browse files Browse the repository at this point in the history
This splits the 3rdparty drivers into seperate
packages as recommended by upstream. This also
allows to build a indi-full equivalent with only
the needed drivers. Also add indi-full-nonfree
with all the nonfree drivers. And remove them
from indi-full.
  • Loading branch information
returntoreality committed Aug 17, 2024
1 parent 8aaa39a commit d2367c3
Show file tree
Hide file tree
Showing 10 changed files with 1,126 additions and 218 deletions.
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2411.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@

- `programs.vim.defaultEditor` now only works if `programs.vim.enable` is enabled.

- The `indi-full` package no longer contains non-free drivers.
To get the old collection of drivers use `indi-full-nonfree` or create your own collection of drivers by overriding indi-with-drivers.
E.g.: `pkgs.indi-with-drivers.override {extraDrivers = with pkgs.indi-3rdparty; [indi-gphoto];}`

- `/share/vim-plugins` now only gets linked if `programs.vim.enable` is enabled

- The `tracy` package no longer works on X11, since it's moved to Wayland
Expand Down
15 changes: 15 additions & 0 deletions pkgs/by-name/in/indi-full-nonfree/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
lib,
stdenv,
indi-3rdparty,
indilib,
indi-with-drivers,
}:

indi-with-drivers.override {
pname = "indi-full-nonfree";
inherit (indilib) version;
extraDrivers = builtins.filter (attrs: lib.meta.availableOn stdenv.hostPlatform attrs) (
builtins.attrValues indi-3rdparty
);
}
23 changes: 23 additions & 0 deletions pkgs/by-name/in/indi-full/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
lib,
stdenv,
indi-3rdparty,
indi-with-drivers,
indilib,
}:

let
licenseFree = p: p.meta.license.free or false;
isFree =
p:
(builtins.all licenseFree ((p.buildInputs or [ ]) ++ (p.propagatedBuildInputs or [ ])))
&& licenseFree p;
drivers = builtins.filter (
attrs: isFree attrs && (lib.meta.availableOn stdenv.hostPlatform attrs)
) (builtins.attrValues indi-3rdparty);
in
indi-with-drivers.override {
pname = "indi-full";
inherit (indilib) version;
extraDrivers = drivers;
}
24 changes: 24 additions & 0 deletions pkgs/by-name/in/indi-with-drivers/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
lib,
buildEnv,
makeBinaryWrapper,
indilib ? indilib,
pname ? "indi-with-drivers",
version ? indilib.version,
extraDrivers ? [ ],
}:

buildEnv {
name = "${pname}-${version}";

paths = [ indilib ] ++ extraDrivers;

nativeBuildInputs = [ makeBinaryWrapper ];

postBuild = lib.optionalString (extraDrivers != [ ]) ''
rm $out/bin/indiserver
makeBinaryWrapper ${indilib}/bin/indiserver $out/bin/indiserver --set-default INDIPREFIX $out
'';

inherit (indilib) meta;
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ stdenv.mkDerivation (finalAttrs: {
description = "Implementation of the INDI protocol for POSIX operating systems";
changelog = "https://github.com/indilib/indi/releases/tag/v${finalAttrs.version}";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ hjones2199 sheepforce ];
maintainers = with maintainers; [ hjones2199 sheepforce returntoreality ];
platforms = platforms.unix;
};
})
Loading

0 comments on commit d2367c3

Please sign in to comment.