Compare commits

...

3 Commits

Author SHA1 Message Date
54913f0ef5 fix: remove task count limits 2026-04-17 14:04:07 +02:00
eeff3fc44c feat: alias 'kubectl' to 'k' 2026-04-17 12:49:48 +02:00
50d6e681f6 fix: add 'devenv' to 'astyanax' and 'work' hosts 2026-04-17 12:49:48 +02:00
6 changed files with 6 additions and 71 deletions

View File

@@ -1,29 +0,0 @@
#!/usr/bin/env python3
import sys
import json
SLOTS_FILE = "/home/h/.local/share/task/add_slots"
def get_slots():
try:
with open(SLOTS_FILE, "r") as f:
return int(f.read().strip())
except:
return 0
slots = get_slots()
if slots <= 0:
print(f"Cannot add task: No slots available (0/{slots}).")
print("Delete or complete a task first to earn an add slot.")
sys.exit(1)
with open(SLOTS_FILE, "w") as f:
f.write(str(slots - 1))
print(f"Task added. Slots remaining: {slots - 1}")
for line in sys.stdin:
task = json.loads(line)
print(json.dumps(task))
sys.exit(0)

View File

@@ -1,34 +0,0 @@
#!/usr/bin/env python3
import sys
import json
SLOTS_FILE = "/home/h/.local/share/task/add_slots"
def get_slots():
try:
with open(SLOTS_FILE, "r") as f:
return int(f.read().strip())
except:
return 0
data = sys.stdin.read().strip().split("\n")
if len(data) < 2:
for line in data:
if line:
print(line)
sys.exit(0)
old_task = json.loads(data[0])
new_task = json.loads(data[1])
was_pending = old_task.get("status") == "pending"
is_not_pending = new_task.get("status") in ("completed", "deleted")
if was_pending and is_not_pending:
slots = get_slots() + 1
with open(SLOTS_FILE, "w") as f:
f.write(str(slots))
print(f"Slot earned! Total slots: {slots}")
print(json.dumps(new_task))
sys.exit(0)

View File

@@ -15,6 +15,7 @@
../../modules/cloud ../../modules/cloud
../../modules/comms ../../modules/comms
../../modules/desktop/niri ../../modules/desktop/niri
../../modules/devenv
../../modules/direnv ../../modules/direnv
../../modules/git ../../modules/git
../../modules/k8s/k9s.nix ../../modules/k8s/k9s.nix

View File

@@ -21,6 +21,7 @@ in
../../modules/database ../../modules/database
../../modules/dconf ../../modules/dconf
../../modules/desktop/niri ../../modules/desktop/niri
../../modules/devenv
../../modules/direnv ../../modules/direnv
../../modules/docker ../../modules/docker
../../modules/git ../../modules/git

View File

@@ -18,6 +18,10 @@
enableAlias = true; enableAlias = true;
}; };
home.shellAliases = {
k = "kubectl";
};
imports = [ imports = [
./helm.nix ./helm.nix
./k9s.nix ./k9s.nix

View File

@@ -56,14 +56,6 @@ lib.optionalAttrs standalone {
".local/share/task/hooks/on-exit.sync.py" = { ".local/share/task/hooks/on-exit.sync.py" = {
source = dotsPath + "/.local/share/task/hooks/on-exit.sync.py"; source = dotsPath + "/.local/share/task/hooks/on-exit.sync.py";
}; };
".local/share/task/hooks/on-add.limit.py" = {
source = dotsPath + "/.local/share/task/hooks/on-add.limit.py";
executable = true;
};
".local/share/task/hooks/on-modify.limit.py" = {
source = dotsPath + "/.local/share/task/hooks/on-modify.limit.py";
executable = true;
};
".local/share/task/scripts/sync-and-notify.sh" = { ".local/share/task/scripts/sync-and-notify.sh" = {
source = dotsPath + "/.local/share/task/scripts/sync-and-notify.sh"; source = dotsPath + "/.local/share/task/scripts/sync-and-notify.sh";
executable = true; executable = true;