Did you know that it is rather easy to setup a VM to test your NixOs configuration?
# flake.nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";| # First add this module to your /etc/nixos/configuration.nix | |
| # ... | |
| # imports = [ /path/to/iphone.nix ]; | |
| # iphone.enable = true; | |
| # iphone.user = "yourusername"; | |
| # ... | |
| # Then rebuild system. Attach iPhone via cable, open terminal and run command `iphone` | |
| # It will fail, but there will occure a dialog on your iPhone to "trust this computer" | |
| # Press OK there and run `iphone` again. If it succeeds it will open a freshly mounted folder |
| import asyncio | |
| import psycopg2 | |
| # dbname should be the same for the notifying process | |
| conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
| conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| cursor = conn.cursor() | |
| cursor.execute(f"LISTEN match_updates;") |