mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 10:14:09 +02:00
27 lines
915 B
Nix
27 lines
915 B
Nix
{
|
|
rustPlatform,
|
|
coreutils,
|
|
lib,
|
|
}: let
|
|
inherit (lib.sources) sourceByRegex;
|
|
inherit (builtins) fromTOML readFile;
|
|
src = sourceByRegex ./. ["Cargo.*" "(src|benches)(/.*)?"];
|
|
version = (fromTOML (readFile ./Cargo.toml)).package.version;
|
|
in
|
|
rustPlatform.buildRustPackage {
|
|
pname = "sidewindow";
|
|
|
|
inherit src version;
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/lib/udev/rules.d/
|
|
echo 'SUBSYSTEM=="powercap", ACTION=="add", RUN+="${coreutils}/bin/chgrp -R powermonitoring /sys%p", RUN+="${coreutils}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-sidewindow.rules
|
|
echo 'SUBSYSTEM=="powercap", ACTION=="change", ENV{TRIGGER}!="none", RUN+="${coreutils}/bin/chgrp -R powermonitoring /sys%p", RUN+="${coreutils}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-sidewindow.rules
|
|
'';
|
|
}
|