Merge pull request #260702 from NixOS/projecteur/add-nixos-module

nixos/modules/projecteur: init
This commit is contained in:
Pol Dellaiera 2023-10-13 17:11:05 +02:00 committed by GitHub
commit 948c4d7de2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 10 deletions

View file

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
let
cfg = config.programs.projecteur;
in
{
options.programs.projecteur = {
enable = lib.mkEnableOption (lib.mdDoc "projecteur");
package = lib.mkPackageOptionMD pkgs "projecteur" { };
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
};
meta = {
maintainers = with lib.maintainers; [ benneti drupol ];
};
}

View file

@ -1,6 +1,13 @@
{ lib, mkDerivation, fetchFromGitHub,
cmake, pkg-config,
qtbase, qtgraphicaleffects, wrapQtAppsHook }:
{ lib
, mkDerivation
, fetchFromGitHub
, cmake
, pkg-config
, qtbase
, qtgraphicaleffects
, wrapQtAppsHook
}:
mkDerivation rec {
pname = "projecteur";
version = "0.9.2";
@ -10,15 +17,23 @@ mkDerivation rec {
repo = "Projecteur";
rev = "v${version}";
fetchSubmodules = false;
sha256 = "sha256-kg6oYtJ4H5A6RNATBg+XvMfCb9FlhEBFjfxamGosMQg=";
hash = "sha256-kg6oYtJ4H5A6RNATBg+XvMfCb9FlhEBFjfxamGosMQg=";
};
postPatch = ''
sed '1i#include <array>' -i src/device.h # gcc12
'';
buildInputs = [ qtbase qtgraphicaleffects ];
nativeBuildInputs = [ wrapQtAppsHook cmake pkg-config ];
buildInputs = [
qtbase
qtgraphicaleffects
];
nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
];
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX:PATH=${placeholder "out"}"
@ -26,11 +41,12 @@ mkDerivation rec {
"-DCMAKE_INSTALL_UDEVRULESDIR=${placeholder "out"}/lib/udev/rules.d"
];
meta = with lib; {
meta = {
description = "Linux/X11 application for the Logitech Spotlight device (and similar devices).";
homepage = "https://github.com/jahnf/Projecteur";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ benneti ];
license = lib.licenses.mit;
mainProgram = "projecteur";
maintainers = with lib.maintainers; [ benneti drupol ];
platforms = lib.platforms.linux;
};
}