mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-01 02:23:54 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitLab
|
|
, pkg-config
|
|
, systemd
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "supergfxctl";
|
|
version = "5.2.4";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "asus-linux";
|
|
repo = "supergfxctl";
|
|
rev = version;
|
|
hash = "sha256-ie5JPHBvypUtPStwA/aO4GeQ/qbHTzUJF3T4QuW6JNc=";
|
|
};
|
|
|
|
cargoHash = "sha256-qZC4axeRnKgUNGDFzmdvN/mwkcqsh8KwLlM6oGT19e8=";
|
|
|
|
postPatch = ''
|
|
substituteInPlace data/supergfxd.service --replace /usr/bin/supergfxd $out/bin/supergfxd
|
|
substituteInPlace data/99-nvidia-ac.rules --replace /usr/bin/systemctl ${systemd}/bin/systemctl
|
|
'';
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = [ systemd ];
|
|
|
|
# upstream doesn't have tests, don't build twice just to find that out
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
install -Dm444 -t $out/lib/udev/rules.d/ data/*.rules
|
|
install -Dm444 -t $out/share/dbus-1/system.d/ data/org.supergfxctl.Daemon.conf
|
|
install -Dm444 -t $out/lib/systemd/system/ data/supergfxd.service
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "GPU switching utility, mostly for ASUS laptops";
|
|
homepage = "https://gitlab.com/asus-linux/supergfxctl";
|
|
license = licenses.mpl20;
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = [ maintainers.k900 ];
|
|
};
|
|
}
|