mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-18 02:00:12 +01:00
fix examples in flake
This commit is contained in:
parent
843f5a03a6
commit
0fe885e231
38
flake.nix
38
flake.nix
|
@ -54,7 +54,11 @@
|
|||
lzma
|
||||
];
|
||||
makeExample =
|
||||
package: example:
|
||||
{
|
||||
package,
|
||||
example,
|
||||
features ? "",
|
||||
}:
|
||||
naersk'.buildPackage {
|
||||
pname = example;
|
||||
cargoBuildOptions =
|
||||
|
@ -68,9 +72,12 @@
|
|||
nativeBuildInputs = nativeBuildInputs;
|
||||
strictDeps = true;
|
||||
buildInputs = buildInputs;
|
||||
gitSubmodules = true;
|
||||
overrideMain = old: {
|
||||
preConfigure = ''
|
||||
cargo_build_options="$cargo_build_options --example ${example}"
|
||||
cargo_build_options="$cargo_build_options --example ${example} ${
|
||||
if features == "" then "" else "--features " + features
|
||||
}"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -95,11 +102,28 @@
|
|||
in
|
||||
rec {
|
||||
servicepoint = makePackage "servicepoint";
|
||||
announce = makeExample "servicepoint" "announce";
|
||||
game-of-life = makeExample "servicepoint" "game_of_life";
|
||||
moving-line = makeExample "servicepoint" "moving_line";
|
||||
random-brightness = makeExample "servicepoint" "random_brightness";
|
||||
wiping-clear = makeExample "servicepoint" "wiping_clear";
|
||||
announce = makeExample {
|
||||
package = "servicepoint";
|
||||
example = "announce";
|
||||
};
|
||||
game-of-life = makeExample {
|
||||
package = "servicepoint";
|
||||
example = "game_of_life";
|
||||
features = "rand";
|
||||
};
|
||||
moving-line = makeExample {
|
||||
package = "servicepoint";
|
||||
example = "moving_line";
|
||||
};
|
||||
random-brightness = makeExample {
|
||||
package = "servicepoint";
|
||||
example = "random_brightness";
|
||||
features = "rand";
|
||||
};
|
||||
wiping-clear = makeExample {
|
||||
package = "servicepoint";
|
||||
example = "wiping_clear";
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue