Merge pull request #300711 from codifryed/coolercontrol
coolercontrol.*: 1.1.1 -> 1.2.2
This commit is contained in:
@@ -10,28 +10,50 @@ in
|
||||
{
|
||||
##### interface
|
||||
options = {
|
||||
programs.coolercontrol.enable = lib.mkEnableOption (lib.mdDoc "CoolerControl GUI & its background services");
|
||||
};
|
||||
programs.coolercontrol = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "CoolerControl GUI & its background services");
|
||||
|
||||
##### implementation
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs.coolercontrol; [
|
||||
coolercontrol-gui
|
||||
];
|
||||
|
||||
systemd = {
|
||||
packages = with pkgs.coolercontrol; [
|
||||
coolercontrol-liqctld
|
||||
coolercontrold
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/81138
|
||||
services = {
|
||||
coolercontrol-liqctld.wantedBy = [ "multi-user.target" ];
|
||||
coolercontrold.wantedBy = [ "multi-user.target" ];
|
||||
nvidiaSupport = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = lib.elem "nvidia" config.services.xserver.videoDrivers;
|
||||
defaultText = lib.literalExpression "lib.elem \"nvidia\" config.services.xserver.videoDrivers";
|
||||
description = lib.mdDoc ''
|
||||
Enable support for Nvidia GPUs.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
##### implementation
|
||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||
# Common
|
||||
({
|
||||
environment.systemPackages = with pkgs.coolercontrol; [
|
||||
coolercontrol-gui
|
||||
];
|
||||
|
||||
systemd = {
|
||||
packages = with pkgs.coolercontrol; [
|
||||
coolercontrol-liqctld
|
||||
coolercontrold
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/81138
|
||||
services = {
|
||||
coolercontrol-liqctld.wantedBy = [ "multi-user.target" ];
|
||||
coolercontrold.wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
# Nvidia support
|
||||
(lib.mkIf cfg.nvidiaSupport {
|
||||
systemd.services.coolercontrold.path = with config.boot.kernelPackages; [
|
||||
nvidia_x11 # nvidia-smi
|
||||
nvidia_x11.settings # nvidia-settings
|
||||
];
|
||||
})
|
||||
]);
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ OPNA2608 codifryed ];
|
||||
}
|
||||
|
||||
+546
-296
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ rustPlatform.buildRustPackage {
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
outputHashes = {
|
||||
"tauri-plugin-autostart-0.0.0" = "sha256-ATw3dbvG3IsLaLBg5wGk7hVRqipwL4xPGKdtD9a5VIw=";
|
||||
"tauri-plugin-localhost-0.1.0" = "sha256-z+cxkNtaaV7m7Rt2mpdw0Rm0oDR4VZPKwtdhY5V/HlI=";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ buildNpmPackage {
|
||||
inherit version src;
|
||||
sourceRoot = "${src.name}/coolercontrol-ui";
|
||||
|
||||
npmDepsHash = "sha256-7Hd1LT1ro83QMuoDGvFGsrTlQaSia+lVG8lyaAibiAo=";
|
||||
npmDepsHash = "sha256-ZnuTtksB+HVYobL48S3RI8Ibe3pvDaF+YFAJJumiNxA=";
|
||||
|
||||
postBuild = ''
|
||||
cp -r dist $out
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
, buildNpmPackage
|
||||
, testers
|
||||
, coolercontrol
|
||||
, runtimeShell
|
||||
}:
|
||||
|
||||
{ version
|
||||
@@ -14,13 +15,17 @@ rustPlatform.buildRustPackage {
|
||||
inherit version src;
|
||||
sourceRoot = "${src.name}/coolercontrold";
|
||||
|
||||
cargoHash = "sha256-Ybqr36AkcPnGJeFcCqg/zuWcaooZ1gJPCi5IbgXmeJ0=";
|
||||
cargoHash = "sha256-qXZ/LXbKkLvnEQibGyMvkkYhz2eEGUHsYxVF3EbCpFc=";
|
||||
|
||||
# copy the frontend static resources to a directory for embedding
|
||||
postPatch = ''
|
||||
# copy the frontend static resources to a directory for embedding
|
||||
mkdir -p ui-build
|
||||
cp -R ${coolercontrol.coolercontrol-ui-data}/* ui-build/
|
||||
substituteInPlace build.rs --replace '"./resources/app"' '"./ui-build"'
|
||||
|
||||
# Hardcode a shell
|
||||
substituteInPlace src/repositories/utils.rs \
|
||||
--replace-fail 'Command::new("sh")' 'Command::new("${runtimeShell}")'
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
}:
|
||||
|
||||
let
|
||||
version = "1.1.1";
|
||||
version = "1.2.2";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "coolercontrol";
|
||||
repo = "coolercontrol";
|
||||
rev = version;
|
||||
hash = "sha256-QgUYfiiADKVHqOU9WTv+VAqep0IU6Ezy8ZzJwkdHIJQ=";
|
||||
hash = "sha256-c+MM8MAM8WSKSKECSfy/Iw7KWiWHxG75YShtv9d2Sjc=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user