nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 nix-update-script,
6}:
7
8stdenv.mkDerivation (finalAttrs: {
9 pname = "ugreen-leds-cli";
10 version = "0.3";
11
12 src = fetchFromGitHub {
13 owner = "miskcoo";
14 repo = "ugreen_leds_controller";
15 tag = "v${finalAttrs.version}";
16 hash = "sha256-eSTOUHs4y6n4cacpjQAp4JIfyu40aBJEMsvuCN6RFZc=";
17 };
18 sourceRoot = "${finalAttrs.src.name}/cli";
19
20 passthru.updateScript = nix-update-script { };
21
22 postPatch = ''
23 substituteInPlace Makefile --replace-warn "-static" ""
24 '';
25
26 installPhase = ''
27 runHook preInstall
28 install -Dm755 ugreen_leds_cli $out/bin/ugreen_leds_cli
29 runHook postInstall
30 '';
31
32 meta = {
33 description = "CLI tool to control UGREEN NAS LEDs";
34 homepage = "https://github.com/miskcoo/ugreen_leds_controller";
35 license = lib.licenses.mit;
36 mainProgram = "ugreen_leds_cli";
37 maintainers = with lib.maintainers; [ michaelvanstraten ];
38 platforms = lib.platforms.linux;
39 };
40})