Improved? battery life + pkgs functions
This commit is contained in:
parent
3d5d222c1d
commit
ed48a77b93
7 changed files with 115 additions and 21 deletions
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
custom,
|
||||
writeCppScriptBin,
|
||||
lib,
|
||||
jq,
|
||||
deploy-rs,
|
||||
...
|
||||
}:
|
||||
custom.writeCppScriptBin {
|
||||
writeCppScriptBin {
|
||||
name = "deploy-rs-online";
|
||||
code = ''
|
||||
#include <string>
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
gcc,
|
||||
writeText,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
{
|
||||
name,
|
||||
code,
|
||||
buildInputs ? [],
|
||||
cxxFlags ? "-std=c++23 -O2 -Wall",
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = name;
|
||||
version = "1.0";
|
||||
src = writeText "${name}.cpp" code;
|
||||
inherit buildInputs;
|
||||
nativeBuildInputs = [gcc];
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p build
|
||||
$CXX ${cxxFlags} -o ${name} $src \
|
||||
${concatStringsSep " " (map (lib: "-I${lib}/include") buildInputs)} \
|
||||
${concatStringsSep " " (map (lib: "-L${lib}/lib") buildInputs)} \
|
||||
${concatStringsSep " " (map (lib: "-l" + builtins.baseNameOf lib) buildInputs)}
|
||||
'';
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ${name} $out/bin/
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue