deepcool-digital-linux: init package and module (#418236)
This commit is contained in:
@@ -638,6 +638,7 @@
|
||||
./services/hardware/brltty.nix
|
||||
./services/hardware/buffyboard.nix
|
||||
./services/hardware/ddccontrol.nix
|
||||
./services/hardware/deepcool-digital-linux.nix
|
||||
./services/hardware/display.nix
|
||||
./services/hardware/fancontrol.nix
|
||||
./services/hardware/freefall.nix
|
||||
|
||||
47
nixos/modules/services/hardware/deepcool-digital-linux.nix
Normal file
47
nixos/modules/services/hardware/deepcool-digital-linux.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.hardware.deepcool-digital-linux;
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.NotAShelf ];
|
||||
|
||||
options.services.hardware.deepcool-digital-linux = {
|
||||
enable = lib.mkEnableOption "DeepCool Digital monitoring daemon";
|
||||
package = lib.mkPackageOption pkgs "deepcool-digital-linux" { };
|
||||
|
||||
extraArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
example = lib.literalExpression ''
|
||||
[
|
||||
# Change the update interval
|
||||
"--update 750"
|
||||
# Enable the alarm
|
||||
"--alarm"
|
||||
]
|
||||
'';
|
||||
description = ''
|
||||
Extra command line arguments to be passed to the deepcool-digital-linux daemon.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
systemd.services.deepcool-digital-linux = {
|
||||
description = "DeepCool Digital";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
StateDirectory = "deepcool-digital-linux";
|
||||
WorkingDirectory = "/var/lib/deepcool-digital-linux";
|
||||
ExecStart = "${lib.getExe cfg.package} ${lib.escapeShellArgs cfg.extraArgs}";
|
||||
Restart = "always";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
44
pkgs/by-name/de/deepcool-digital-linux/package.nix
Normal file
44
pkgs/by-name/de/deepcool-digital-linux/package.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
pkg-config,
|
||||
libudev-zero,
|
||||
versionCheckHook,
|
||||
nix-update-script,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "deepcool-digital-linux";
|
||||
version = "0.8.3-alpha";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Nortank12";
|
||||
repo = "deepcool-digital-linux";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Whmjd6NCOUkE7hM3FaN7grMwcC/suL7AJDVSgnZSKzM=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-K1pEbUyENPUS4QK0lztWmw8ov1fGrx8KHdODmSByfek=";
|
||||
|
||||
buildInputs = [ libudev-zero ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
doInstallCheck = false; # FIXME: version cmd returns 0.8.3, set to true when we switch to a stable version
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "--version";
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/Nortank12/deepcool-digital-linux/releases/tag/v${finalAttrs.version}";
|
||||
description = "Linux version for the DeepCool Digital Windows software";
|
||||
homepage = "https://github.com/Nortank12/deepcool-digital-linux";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ NotAShelf ];
|
||||
mainProgram = "deepcool-digital-linux";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user