summaryrefslogtreecommitdiff
path: root/pkgs/cachyos-settings/default.nix
blob: 006dbf932641839fa7ca67a4be5f15aa43eec4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
  stdenv,
  fetchFromGitHub,
  bash,
  hdparm,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "cachyos-settings";
  version = "1.3.5";

  src = fetchFromGitHub {
    owner = "CachyOS";
    repo = "CachyOS-Settings";
    tag = finalAttrs.version;
    hash = "sha256-hAYnrfzqwLbi7Y/nrJgy4voZ+K3Tvx+Dt35JS+kizQc=";
  };

  dontBuild = true;
  dontConfigure = true;

  postPatch = ''
    substituteInPlace usr/lib/udev/rules.d/*.rules \
      --replace "/bin/sh" "${bash}/bin/sh" \
      --replace "/usr/bin/bash" "${bash}/bin/bash" \
      --replace "/usr/bin/hdparm" "${hdparm}/bin/hdparm"
  '';

  installPhase = ''
    mkdir -p $out/etc/udev/rules.d
    cp usr/lib/udev/rules.d/*.rules $out/etc/udev/rules.d
    mkdir -p $out/etc/sysctl.d
    cp usr/lib/sysctl.d/*.conf $out/etc/sysctl.d
  '';
})