mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #95337 from pasqui23/switchctl
This commit is contained in:
commit
493bbc968b
3 changed files with 78 additions and 0 deletions
18
nixos/modules/hardware/video/switcheroo-control.nix
Normal file
18
nixos/modules/hardware/video/switcheroo-control.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
pkg = [ pkgs.switcheroo-control ];
|
||||
cfg = config.services.switcherooControl;
|
||||
in {
|
||||
options.services.switcherooControl = {
|
||||
enable = mkEnableOption "switcheroo-control, a D-Bus service to check the availability of dual-GPU";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.dbus.packages = pkg;
|
||||
environment.systemPackages = pkg;
|
||||
systemd.packages = pkg;
|
||||
systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
|
||||
};
|
||||
}
|
58
pkgs/os-specific/linux/switcheroo-control/default.nix
Normal file
58
pkgs/os-specific/linux/switcheroo-control/default.nix
Normal file
|
@ -0,0 +1,58 @@
|
|||
{ lib
|
||||
, ninja
|
||||
, meson
|
||||
, fetchFromGitLab
|
||||
, systemd
|
||||
, libgudev
|
||||
, pkg-config
|
||||
, glib
|
||||
, python3
|
||||
, gobject-introspection
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "switcheroo-control";
|
||||
version = "2.3";
|
||||
|
||||
format = "other";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
domain = "gitlab.freedesktop.org";
|
||||
owner = "hadess";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-1Pze2TJ9mggfcpiLFwJ7/9WhsdJx4G3GoA7+Z47shuc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
ninja
|
||||
meson
|
||||
pkg-config
|
||||
|
||||
# needed for glib-compile-resources
|
||||
glib
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
systemd
|
||||
libgudev
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
python3.pkgs.pygobject3
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
||||
"-Dhwdbdir=${placeholder "out"}/etc/udev/hwdb.d"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "D-Bus service to check the availability of dual-GPU";
|
||||
homepage = "https://gitlab.freedesktop.org/hadess/switcheroo-control/";
|
||||
changelog = "https://gitlab.freedesktop.org/hadess/switcheroo-control/-/blob/${version}/NEWS";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = [ ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
|
@ -18436,6 +18436,8 @@ in
|
|||
|
||||
storm = callPackage ../servers/computing/storm { };
|
||||
|
||||
switcheroo-control = callPackage ../os-specific/linux/switcheroo-control { };
|
||||
|
||||
slurm = callPackage ../servers/computing/slurm { gtk2 = null; };
|
||||
|
||||
slurm-spank-x11 = callPackage ../servers/computing/slurm-spank-x11 { };
|
||||
|
|
Loading…
Reference in a new issue