mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
fix broken references to deleted files, remove dead code
Build-breaking fixes: - kibbeh: remove imports of deleted admin-essentials, nix, zsh configs (all provided by niphas via profiles.default + profiles.desktop) - tabula, tahina: remove imports of deleted admin-essentials, nix configs (provided by niphas via profiles.default) - zaatar: remove import of deleted tmux config (provided by niphas via profiles.default) Dead code removal: - flake.nix: remove nixosModules.zsh-kmein (referenced deleted config/zsh.nix) - flake.nix: remove unused wallpapers input - packages/gpt.nix, hora.nix, k-lock.nix: orphaned, not in overlay or referenced - configs/hledger.nix: remove hora reference (package deleted)
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
{
|
||||
curl,
|
||||
writers,
|
||||
jq,
|
||||
apiKeyCommand ? "pass api-keys/openai.com",
|
||||
model ? "gpt-3.5-turbo",
|
||||
}:
|
||||
writers.writeDashBin "gpt" ''
|
||||
json=$(jq --slurp --raw-input '{model:"${model}", messages: [{role: "user", content: .}]}')
|
||||
${curl}/bin/curl -sSL https://api.openai.com/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $(${apiKeyCommand})" \
|
||||
-d "$json" \
|
||||
| ${jq}/bin/jq -r '.choices[] | .message.content'
|
||||
''
|
||||
@@ -1,81 +0,0 @@
|
||||
{
|
||||
symlinkJoin,
|
||||
hledger,
|
||||
writers,
|
||||
lib,
|
||||
git,
|
||||
coreutils,
|
||||
gnugrep,
|
||||
timeLedger,
|
||||
...
|
||||
}:
|
||||
let
|
||||
date = "${coreutils}/bin/date +'%Y-%m-%d %H:%M:%S'";
|
||||
|
||||
hora = writers.writeDashBin "hora" "${hledger}/bin/hledger -f ${lib.escapeShellArg timeLedger} \"$@\"";
|
||||
hora-edit = writers.writeDashBin "hora-edit" "$EDITOR ${lib.escapeShellArg timeLedger}";
|
||||
hora-status = writers.writeDashBin "hora-status" "${coreutils}/bin/tac ${lib.escapeShellArg timeLedger} | ${gnugrep}/bin/grep -m 1 .";
|
||||
|
||||
hora-start = writers.writeDashBin "hora-start" ''
|
||||
last_nonempty_line=$(${hora-status}/bin/hora-status)
|
||||
(echo $last_nonempty_line | ${gnugrep}/bin/grep -q "^o") || {
|
||||
echo "Last activity must be closed: $last_nonempty_line" >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
account=$1
|
||||
(${hora}/bin/hora accounts | ${gnugrep}/bin/grep -q "^$account\$") || {
|
||||
echo "The account '$account' is not known. Please add manually."
|
||||
exit 1
|
||||
}
|
||||
|
||||
message=$2
|
||||
date=$(${date})
|
||||
echo "i $date $account $message\n" >> "${timeLedger}"
|
||||
echo "Started $account at $date" >/dev/stderr
|
||||
'';
|
||||
|
||||
hora-stop = writers.writeDashBin "hora-stop" ''
|
||||
last_nonempty_line=$(${hora-status}/bin/hora-status)
|
||||
|
||||
(echo $last_nonempty_line | ${gnugrep}/bin/grep "^i") || {
|
||||
echo "Last activity cannot be closed: $last_nonempty_line" >/dev/stderr
|
||||
exit 1
|
||||
}
|
||||
|
||||
last_activity=$(echo "$last_nonempty_line" | ${coreutils}/bin/cut -d' ' -f 4)
|
||||
date=$(${date})
|
||||
|
||||
echo "o $date\n" >> ${timeLedger}
|
||||
echo "Stopped $last_activity at $date" >/dev/stderr
|
||||
'';
|
||||
|
||||
hora-year = writers.writeDashBin "hora-year" ''
|
||||
${hora}/bin/hora balance --tree --monthly --begin $(${coreutils}/bin/date +%Y) --depth 1
|
||||
'';
|
||||
hora-git = writers.writeDashBin "hora-git" ''
|
||||
directory=$(${coreutils}/bin/dirname ${lib.escapeShellArg timeLedger})
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
${git}/bin/git -C "$directory" --all --message=$(${date})
|
||||
else
|
||||
${git}/bin/git -C "$directory" "$@"
|
||||
fi
|
||||
'';
|
||||
hora-weekly = writers.writeDashBin "hora-weekly" ''
|
||||
${hora}/bin/hora register -p weekly --depth 1 --empty
|
||||
'';
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "hora";
|
||||
paths = [
|
||||
hora
|
||||
hora-edit
|
||||
hora-start
|
||||
hora-status
|
||||
hora-stop
|
||||
hora-year
|
||||
hora-git
|
||||
hora-weekly
|
||||
];
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
xlockmore,
|
||||
}:
|
||||
let
|
||||
xlockModes = lib.concatStringsSep "\\n" [
|
||||
# "braid"
|
||||
"galaxy"
|
||||
# "lightning"
|
||||
# "matrix"
|
||||
"pyro2"
|
||||
"space"
|
||||
];
|
||||
in
|
||||
writers.writeDashBin "k-lock" ''
|
||||
MODE=$(printf "${xlockModes}" | shuf -n 1)
|
||||
|
||||
${xlockmore}/bin/xlock \
|
||||
-saturation 0.4 \
|
||||
-erasemode no_fade \
|
||||
+description \
|
||||
-showdate \
|
||||
-username " " \
|
||||
-password " " \
|
||||
-info " " \
|
||||
-validate "..." \
|
||||
-invalid "Computer says no." \
|
||||
-mode "$MODE"
|
||||
''
|
||||
Reference in New Issue
Block a user