mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 10:14:09 +02:00
'native' build
This commit is contained in:
parent
c2c3b43354
commit
a79cc0771a
1 changed files with 12 additions and 6 deletions
18
flake.nix
18
flake.nix
|
|
@ -66,6 +66,12 @@
|
||||||
rustc = toolchain;
|
rustc = toolchain;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
addUdev = ''
|
||||||
|
mkdir -p $out/lib/udev/rules.d/
|
||||||
|
echo 'SUBSYSTEM=="powercap", ACTION=="add", RUN+="${pkgs.coreutils-full}/bin/chgrp -R powermonitoring /sys%p", RUN+="${pkgs.coreutils-full}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-palantir.rules
|
||||||
|
echo 'SUBSYSTEM=="powercap", ACTION=="change", ENV{TRIGGER}!="none", RUN+="${pkgs.coreutils-full}/bin/chgrp -R powermonitoring /sys%p", RUN+="${pkgs.coreutils-full}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-palantir.rules
|
||||||
|
'';
|
||||||
|
|
||||||
buildWindows = target: naersk'.buildPackage {
|
buildWindows = target: naersk'.buildPackage {
|
||||||
pname = "palantir";
|
pname = "palantir";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
@ -86,11 +92,7 @@
|
||||||
pname = "palantir";
|
pname = "palantir";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = addUdev;
|
||||||
mkdir -p $out/lib/udev/rules.d/
|
|
||||||
echo 'SUBSYSTEM=="powercap", ACTION=="add", RUN+="${pkgs.coreutils-full}/bin/chgrp -R powermonitoring /sys%p", RUN+="${pkgs.coreutils-full}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-palantir.rules
|
|
||||||
echo 'SUBSYSTEM=="powercap", ACTION=="change", ENV{TRIGGER}!="none", RUN+="${pkgs.coreutils-full}/bin/chgrp -R powermonitoring /sys%p", RUN+="${pkgs.coreutils-full}/bin/chmod -R g=u /sys%p"' >> $out/lib/udev/rules.d/51-palantir.rules
|
|
||||||
'';
|
|
||||||
|
|
||||||
CARGO_BUILD_TARGET = target;
|
CARGO_BUILD_TARGET = target;
|
||||||
} // (if (pkgs.hostPlatform.config != target) then (crossArgs.${target} or {}) else {}));
|
} // (if (pkgs.hostPlatform.config != target) then (crossArgs.${target} or {}) else {}));
|
||||||
|
|
@ -98,7 +100,11 @@
|
||||||
in rec {
|
in rec {
|
||||||
# `nix build`
|
# `nix build`
|
||||||
packages = nixpkgs.lib.attrsets.genAttrs targets buildAny;
|
packages = nixpkgs.lib.attrsets.genAttrs targets buildAny;
|
||||||
defaultPackage = packages.${pkgs.hostPlatform.config};
|
defaultPackage = naersk'.buildPackage {
|
||||||
|
pname = "palantir";
|
||||||
|
src = ./.;
|
||||||
|
postInstall = addUdev;
|
||||||
|
};
|
||||||
|
|
||||||
# `nix run`
|
# `nix run`
|
||||||
apps.palantir = utils.lib.mkApp {
|
apps.palantir = utils.lib.mkApp {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue