1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: rusty alarm

This commit is contained in:
2023-01-07 09:58:31 +01:00
parent 6f6100d752
commit c5a297cd7d
3 changed files with 51 additions and 0 deletions

31
packages/rusty-jeep.nix Normal file
View File

@@ -0,0 +1,31 @@
{
lib,
fetchFromGitHub,
rustPlatform,
pkg-config,
alsa-lib,
}:
rustPlatform.buildRustPackage {
pname = "rusty-jeep";
version = "1.0.0";
src = let
repo = fetchFromGitHub {
owner = "kmein";
repo = "scripts";
rev = "c8e80b34c08e427f83b6af19a361e8c0711a4e6c";
sha256 = "18jlf9zkhni4jsvzrlkkllqvv5dkhjmilggcchbs32hr1km51q84";
};
in "${repo}/rusty-jeep";
nativeBuildInputs = [pkg-config];
buildInputs = [alsa-lib];
cargoHash = "sha256-8qbYTqRk+4InJNX6xK95VxISamDb5KID+wbmUDJYJ94=";
meta = with lib; {
description = "A beeping program inspired by K_belwagen";
license = licenses.wtfpl;
maintainers = [maintainers.kmein];
};
}

View File

@@ -33,6 +33,25 @@ in
name = "instaget";
};
alarm = let
rusty-jeep = pkgs.callPackage ../rusty-jeep.nix {};
in
pkgs.writers.writeDashBin "alarm" ''
export PATH=${lib.makeBinPath [pkgs.coreutils pkgs.bc rusty-jeep]}
for i in `seq 8000 1000 10000`; do
echo $i 100
done | rusty-jeep
echo 'if you heard that sound, then goto sleep..^_^'
echo sleep "$@"
sleep "$@"
echo 'wake up!'
while :; do
echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc)
done | rusty-jeep 1
'';
infschmv = pkgs.writers.writeDashBin "InfSchMV" ''
${pkgs.curl}/bin/curl -sSL https://www.berlin.de/corona/massnahmen/verordnung/ \
| ${pkgs.pup}/bin/pup .textile \