diff --git a/flake.lock b/flake.lock index b8383bc..baa2c4e 100644 --- a/flake.lock +++ b/flake.lock @@ -211,11 +211,11 @@ }, "nixlib": { "locked": { - "lastModified": 1732410305, - "narHash": "sha256-/hxIKRTBsdrnudJWDGaBN8wIjHovqVAVxXdi8ByVtck=", + "lastModified": 1731805462, + "narHash": "sha256-yhEMW4MBi+IAyEJyiKbnFvY1uARyMKJpLUhkczI49wk=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "87b6978992e2eb605732fba842cad0a7e14b2047", + "rev": "b9f04e3cf71c23bea21d2768051e6b3068d44734", "type": "github" }, "original": { @@ -232,11 +232,11 @@ ] }, "locked": { - "lastModified": 1732496924, - "narHash": "sha256-/MNhZLR0eh9z/d3l+ammq+F5XxHln0RHgO4Bhtjr0IM=", + "lastModified": 1732151224, + "narHash": "sha256-5IgpueM8SGLOadzUJK6Gk37zEBXGd56BkNOtoWmnZos=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "098e8b6ff72c86944a8d54b64ddd7b7e6635830a", + "rev": "3280fdde8c8f0276c9f5286ad5c0f433dfa5d56c", "type": "github" }, "original": { @@ -247,11 +247,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1732483221, - "narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=", + "lastModified": 1731797098, + "narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405", + "rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6", "type": "github" }, "original": { @@ -263,11 +263,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733040108, - "narHash": "sha256-x48Dv2n8d0Ebk0Pp6qk5TW4b+oUfkOpl16ick+npjD0=", + "lastModified": 1732237847, + "narHash": "sha256-WwtrPxym9sQtwZkemxUfT00iCWfXxzuVAC7uFP1m1Y0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d44a276324b63ff7ca4254b7ea51d5bac7eb6c64", + "rev": "9bbcb9a5a7e54369faaced5fb0ddad1fda21b751", "type": "github" }, "original": { @@ -279,11 +279,11 @@ }, "nixpkgs-full": { "locked": { - "lastModified": 1732981179, - "narHash": "sha256-F7thesZPvAMSwjRu0K8uFshTk3ZZSNAsXTIFvXBT+34=", + "lastModified": 1731755305, + "narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "62c435d93bf046a5396f3016472e8f7c8e2aed65", + "rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4", "type": "github" }, "original": { @@ -332,11 +332,11 @@ ] }, "locked": { - "lastModified": 1732894027, - "narHash": "sha256-2qbdorpq0TXHBWbVXaTqKoikN4bqAtAplTwGuII+oAc=", + "lastModified": 1732292307, + "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "6209c381904cab55796c5d7350e89681d3b2a8ef", + "rev": "705df92694af7093dfbb27109ce16d828a79155f", "type": "github" }, "original": { diff --git a/home/status b/home/status index 45e78d8..176467a 100755 --- a/home/status +++ b/home/status @@ -5,7 +5,6 @@ import sys import time import requests import logging -import subprocess from datetime import datetime @@ -26,7 +25,7 @@ class Cat(Status): catwalk = " " * (cat_width - index) + 1 * "🐈🏳️‍🌈" + " " * index self.index = (index + 1) % cat_width - return {"full_text": catwalk} + return catwalk class Space(Status): @@ -38,7 +37,7 @@ class Space(Status): if self.backoff == 0: self.update() - return {"full_text": self.c_status} + return self.c_status def update(self): spacestatus_url = "https://status.stratum0.org/status.json" @@ -66,26 +65,12 @@ class Battery(Status): battery = f"{status} {capacity}%" - return {"full_text": battery} + return battery class Time(Status): - def status(self): - 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 status(state): + return datetime.now().strftime("%Vth %A %H:%M") def print_header(): @@ -109,7 +94,7 @@ def run(interval, widgets): except Exception as e: logger.error(e) if status: - body += status, + body += {"full_text": f"{status}"}, print(json.dumps(body), ",", flush=True) @@ -123,6 +108,6 @@ if __name__ == "__main__": # Interval in seconds interval = 1.0 - widgets = [Cat(), FailedUnits(), Space(), Battery(), Time()] + widgets = [Cat(), Space(), Battery(), Time()] run(interval, widgets) diff --git a/nixos/gorgon/configuration.nix b/nixos/gorgon/configuration.nix index 12723e0..e0268e2 100644 --- a/nixos/gorgon/configuration.nix +++ b/nixos/gorgon/configuration.nix @@ -34,8 +34,6 @@ in ./hardware-configuration.nix ]; - dadada.backupClient.bs.enable = false; - dadada.backupClient.backup1.enable = true; dadada.backupClient.backup2 = { enable = true; passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase".path; @@ -180,6 +178,38 @@ in "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; programs.gnupg.agent.enable = true;