nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

deepcool-digital-linux: init package and module (#418236)

authored by

Thiago Kenji Okada and committed by
GitHub
33de6dfc 49237224

+92
+1
nixos/modules/module-list.nix
··· 638 638 ./services/hardware/brltty.nix 639 639 ./services/hardware/buffyboard.nix 640 640 ./services/hardware/ddccontrol.nix 641 + ./services/hardware/deepcool-digital-linux.nix 641 642 ./services/hardware/display.nix 642 643 ./services/hardware/fancontrol.nix 643 644 ./services/hardware/freefall.nix
+47
nixos/modules/services/hardware/deepcool-digital-linux.nix
··· 1 + { 2 + config, 3 + pkgs, 4 + lib, 5 + ... 6 + }: 7 + let 8 + cfg = config.services.hardware.deepcool-digital-linux; 9 + in 10 + { 11 + meta.maintainers = [ lib.maintainers.NotAShelf ]; 12 + 13 + options.services.hardware.deepcool-digital-linux = { 14 + enable = lib.mkEnableOption "DeepCool Digital monitoring daemon"; 15 + package = lib.mkPackageOption pkgs "deepcool-digital-linux" { }; 16 + 17 + extraArgs = lib.mkOption { 18 + type = lib.types.listOf lib.types.str; 19 + default = [ ]; 20 + example = lib.literalExpression '' 21 + [ 22 + # Change the update interval 23 + "--update 750" 24 + # Enable the alarm 25 + "--alarm" 26 + ] 27 + ''; 28 + description = '' 29 + Extra command line arguments to be passed to the deepcool-digital-linux daemon. 30 + ''; 31 + }; 32 + }; 33 + 34 + config = lib.mkIf cfg.enable { 35 + environment.systemPackages = [ cfg.package ]; 36 + systemd.services.deepcool-digital-linux = { 37 + description = "DeepCool Digital"; 38 + wantedBy = [ "multi-user.target" ]; 39 + serviceConfig = { 40 + StateDirectory = "deepcool-digital-linux"; 41 + WorkingDirectory = "/var/lib/deepcool-digital-linux"; 42 + ExecStart = "${lib.getExe cfg.package} ${lib.escapeShellArgs cfg.extraArgs}"; 43 + Restart = "always"; 44 + }; 45 + }; 46 + }; 47 + }
+44
pkgs/by-name/de/deepcool-digital-linux/package.nix
··· 1 + { 2 + lib, 3 + rustPlatform, 4 + fetchFromGitHub, 5 + pkg-config, 6 + libudev-zero, 7 + versionCheckHook, 8 + nix-update-script, 9 + }: 10 + rustPlatform.buildRustPackage (finalAttrs: { 11 + pname = "deepcool-digital-linux"; 12 + version = "0.8.3-alpha"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "Nortank12"; 16 + repo = "deepcool-digital-linux"; 17 + tag = "v${finalAttrs.version}"; 18 + hash = "sha256-Whmjd6NCOUkE7hM3FaN7grMwcC/suL7AJDVSgnZSKzM="; 19 + }; 20 + 21 + cargoHash = "sha256-K1pEbUyENPUS4QK0lztWmw8ov1fGrx8KHdODmSByfek="; 22 + 23 + buildInputs = [ libudev-zero ]; 24 + 25 + nativeBuildInputs = [ 26 + pkg-config 27 + ]; 28 + 29 + doInstallCheck = false; # FIXME: version cmd returns 0.8.3, set to true when we switch to a stable version 30 + nativeInstallCheckInputs = [ versionCheckHook ]; 31 + versionCheckProgramArg = "--version"; 32 + 33 + passthru.updateScript = nix-update-script { }; 34 + 35 + meta = { 36 + changelog = "https://github.com/Nortank12/deepcool-digital-linux/releases/tag/v${finalAttrs.version}"; 37 + description = "Linux version for the DeepCool Digital Windows software"; 38 + homepage = "https://github.com/Nortank12/deepcool-digital-linux"; 39 + license = lib.licenses.gpl3Only; 40 + maintainers = with lib.maintainers; [ NotAShelf ]; 41 + mainProgram = "deepcool-digital-linux"; 42 + platforms = lib.platforms.linux; 43 + }; 44 + })