Compare commits
3 commits
429f906a1a
...
eb81a1fedf
Author | SHA1 | Date | |
---|---|---|---|
eb81a1fedf | |||
dbb636e7df | |||
165c9822b9 |
3 changed files with 42 additions and 57 deletions
36
flake.lock
generated
36
flake.lock
generated
|
@ -211,11 +211,11 @@
|
||||||
},
|
},
|
||||||
"nixlib": {
|
"nixlib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731805462,
|
"lastModified": 1732410305,
|
||||||
"narHash": "sha256-yhEMW4MBi+IAyEJyiKbnFvY1uARyMKJpLUhkczI49wk=",
|
"narHash": "sha256-/hxIKRTBsdrnudJWDGaBN8wIjHovqVAVxXdi8ByVtck=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "b9f04e3cf71c23bea21d2768051e6b3068d44734",
|
"rev": "87b6978992e2eb605732fba842cad0a7e14b2047",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -232,11 +232,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732151224,
|
"lastModified": 1732496924,
|
||||||
"narHash": "sha256-5IgpueM8SGLOadzUJK6Gk37zEBXGd56BkNOtoWmnZos=",
|
"narHash": "sha256-/MNhZLR0eh9z/d3l+ammq+F5XxHln0RHgO4Bhtjr0IM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "3280fdde8c8f0276c9f5286ad5c0f433dfa5d56c",
|
"rev": "098e8b6ff72c86944a8d54b64ddd7b7e6635830a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -247,11 +247,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731797098,
|
"lastModified": 1732483221,
|
||||||
"narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=",
|
"narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6",
|
"rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -263,11 +263,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732237847,
|
"lastModified": 1733040108,
|
||||||
"narHash": "sha256-WwtrPxym9sQtwZkemxUfT00iCWfXxzuVAC7uFP1m1Y0=",
|
"narHash": "sha256-x48Dv2n8d0Ebk0Pp6qk5TW4b+oUfkOpl16ick+npjD0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9bbcb9a5a7e54369faaced5fb0ddad1fda21b751",
|
"rev": "d44a276324b63ff7ca4254b7ea51d5bac7eb6c64",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -279,11 +279,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-full": {
|
"nixpkgs-full": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731755305,
|
"lastModified": 1732981179,
|
||||||
"narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=",
|
"narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4",
|
"rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -332,11 +332,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732292307,
|
"lastModified": 1732894027,
|
||||||
"narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=",
|
"narHash": "sha256-2qbdorpq0TXHBWbVXaTqKoikN4bqAtAplTwGuII+oAc=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "treefmt-nix",
|
"repo": "treefmt-nix",
|
||||||
"rev": "705df92694af7093dfbb27109ce16d828a79155f",
|
"rev": "6209c381904cab55796c5d7350e89681d3b2a8ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
29
home/status
29
home/status
|
@ -5,6 +5,7 @@ import sys
|
||||||
import time
|
import time
|
||||||
import requests
|
import requests
|
||||||
import logging
|
import logging
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ class Cat(Status):
|
||||||
catwalk = " " * (cat_width - index) + 1 * "🐈🏳️🌈" + " " * index
|
catwalk = " " * (cat_width - index) + 1 * "🐈🏳️🌈" + " " * index
|
||||||
self.index = (index + 1) % cat_width
|
self.index = (index + 1) % cat_width
|
||||||
|
|
||||||
return catwalk
|
return {"full_text": catwalk}
|
||||||
|
|
||||||
|
|
||||||
class Space(Status):
|
class Space(Status):
|
||||||
|
@ -37,7 +38,7 @@ class Space(Status):
|
||||||
if self.backoff == 0:
|
if self.backoff == 0:
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
return self.c_status
|
return {"full_text": self.c_status}
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
spacestatus_url = "https://status.stratum0.org/status.json"
|
spacestatus_url = "https://status.stratum0.org/status.json"
|
||||||
|
@ -65,12 +66,26 @@ class Battery(Status):
|
||||||
|
|
||||||
battery = f"{status} {capacity}%"
|
battery = f"{status} {capacity}%"
|
||||||
|
|
||||||
return battery
|
return {"full_text": battery}
|
||||||
|
|
||||||
|
|
||||||
class Time(Status):
|
class Time(Status):
|
||||||
def status(state):
|
def status(self):
|
||||||
return datetime.now().strftime("%Vth %A %H:%M")
|
return {"full_text": datetime.now().strftime("%Vth %A %H:%M") }
|
||||||
|
|
||||||
|
|
||||||
|
class FailedUnits(Status):
|
||||||
|
def status(self):
|
||||||
|
proc = subprocess.run(["systemctl", "list-units", "--failed"], capture_output = True)
|
||||||
|
stdout = proc.stdout.decode('utf-8')
|
||||||
|
failed = 0
|
||||||
|
for line in stdout:
|
||||||
|
if 'failed' in line:
|
||||||
|
failed += 1
|
||||||
|
if failed is 0:
|
||||||
|
return {"full_text": f"No failed units"}
|
||||||
|
else:
|
||||||
|
return {"full_text": f"There are {failed} failed units", "color": "#ff0000"}
|
||||||
|
|
||||||
|
|
||||||
def print_header():
|
def print_header():
|
||||||
|
@ -94,7 +109,7 @@ def run(interval, widgets):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
if status:
|
if status:
|
||||||
body += {"full_text": f"{status}"},
|
body += status,
|
||||||
|
|
||||||
print(json.dumps(body), ",", flush=True)
|
print(json.dumps(body), ",", flush=True)
|
||||||
|
|
||||||
|
@ -108,6 +123,6 @@ if __name__ == "__main__":
|
||||||
# Interval in seconds
|
# Interval in seconds
|
||||||
interval = 1.0
|
interval = 1.0
|
||||||
|
|
||||||
widgets = [Cat(), Space(), Battery(), Time()]
|
widgets = [Cat(), FailedUnits(), Space(), Battery(), Time()]
|
||||||
|
|
||||||
run(interval, widgets)
|
run(interval, widgets)
|
||||||
|
|
|
@ -34,6 +34,8 @@ in
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
dadada.backupClient.bs.enable = false;
|
||||||
|
dadada.backupClient.backup1.enable = true;
|
||||||
dadada.backupClient.backup2 = {
|
dadada.backupClient.backup2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase".path;
|
passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase".path;
|
||||||
|
@ -178,38 +180,6 @@ in
|
||||||
"127.0.0.2" = [ "kanboard.dadada.li" ];
|
"127.0.0.2" = [ "kanboard.dadada.li" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://lists.zx2c4.com/pipermail/wireguard/2017-November/002028.html
|
|
||||||
systemd.timers.wg-reresolve-dns = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
partOf = [ "wg-reresolve-dns.service" ];
|
|
||||||
timerConfig.OnCalendar = "hourly";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.wg-reresolve-dns =
|
|
||||||
let
|
|
||||||
vpnPubKey = "x/y6I59buVzv9Lfzl+b17mGWbzxU+3Ke9mQNa1DLsDI=";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
script = ''
|
|
||||||
${pkgs.wireguard-tools}/bin/wg set dadada peer ${vpnPubKey} endpoint vpn.dadada.li:51234 persistent-keepalive 25 allowed-ips fd42:9c3b:f96d::/48
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
#networking.wg-quick.interfaces.mullvad = {
|
|
||||||
# address = [ "10.68.15.202/32" "fc00:bbbb:bbbb:bb01::5:fc9/128" ];
|
|
||||||
# privateKeyFile = "/var/lib/wireguard/mullvad";
|
|
||||||
# peers = [
|
|
||||||
# {
|
|
||||||
# publicKey = "Ec/wwcosVal9Kjc97ZuTTV7Dy5c0/W5iLet7jrSEm2k=";
|
|
||||||
# allowedIPs = [ "0.0.0.0/0" "::0/0" ];
|
|
||||||
# endpoint = "193.27.14.66:51820";
|
|
||||||
# persistentKeepalive = 25;
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# postUp = "${pkgs.iproute2}/bin/ip rule add to 193.27.14.66 lookup main";
|
|
||||||
#};
|
|
||||||
|
|
||||||
services.gnome.gnome-keyring.enable = lib.mkForce false;
|
services.gnome.gnome-keyring.enable = lib.mkForce false;
|
||||||
programs.gnupg.agent.enable = true;
|
programs.gnupg.agent.enable = true;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue