14 Commits

Author SHA1 Message Date
marthsincemelee 7a1b0541c2 feat(home-assistant): add Apple TV and Tuya integrations
Enable the apple_tv (pyatv) and tuya (SmartLife cloud) components on
jupiter. Tuya covers the Unistyle WLAN irrigation computer; both are
config-flow integrations paired through the HA web UI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 17:19:53 +02:00
marthsincemelee 6c5f61997d fix: Homepage Domain 2026-06-27 15:45:06 +02:00
finn.markwitz 763253693c chore: Flake Update 2026-06-27 15:28:11 +02:00
finn.markwitz b6f4bb7955 chore: Flake Update 2026-06-23 16:55:42 +02:00
finn.markwitz 74d65a0d75 Revert "chore: flake update"
This reverts commit 85bd12778a.
2026-06-15 11:55:29 +02:00
finn.markwitz 85bd12778a chore: flake update 2026-06-15 11:51:59 +02:00
finn.markwitz d9565448b9 Merge branch 'feature/ha-zbt-2-thread' into 'master'
feat(home-assistant): enable ZHA for ZBT-2 Zigbee dongle

See merge request finn.markwitz/nixos!18
2026-06-09 06:38:56 +00:00
finn.markwitz af2655f9e2 Merge branch 'master' into 'feature/ha-zbt-2-thread'
# Conflicts:
#   machines/mibook/configuration.nix
2026-06-09 06:37:07 +00:00
finn.markwitz 6d0684610e chore: Flake Update 2026-06-09 08:28:11 +02:00
finn.markwitz 17c3a3189f chore(NixOS Version): Update to 26.05 2026-06-09 08:16:08 +02:00
finn.markwitz 18d1ce711d chore(HA): Removed uneccessary Unstable Overlay import 2026-06-09 08:10:45 +02:00
finn.markwitz cbdb42f333 chore: Flake Update 2026-06-01 10:02:27 +02:00
finn.markwitz b44775e3e5 docs: add CLAUDE.md with repo architecture and development commands
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:34:24 +02:00
finn.markwitz 1444912326 config: Disable Prime Sync MiBook 2026-05-17 14:23:55 +02:00
10 changed files with 152 additions and 49 deletions
+92
View File
@@ -0,0 +1,92 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Commands
```bash
# Apply configuration (switch/boot/test)
sudo nixos-rebuild switch --flake '.#jupiter'
sudo nixos-rebuild switch --flake '.#mibook'
# Build without switching (CI-style check)
nix build '.#nixosConfigurations.jupiter.config.system.build.toplevel'
# Update all flake inputs
nix flake update
# Format Nix files
nixfmt-rfc-style <file> # or: find . -name '*.nix' | xargs nixfmt-rfc-style
```
## Architecture
This is a flake-parts NixOS configuration for two machines:
- **jupiter** — home server running media/automation services
- **mibook** — laptop running KDE desktop + development tools
### Module Loading Chain
```
flake.nix
└── machines/configuration.nix # flake-parts module; defines nixosConfigurations
├── machines/core/ # base modules applied to every machine
│ ├── core.nix # system packages, locale, timezone
│ ├── network.nix
│ ├── nix.nix
│ └── users.nix
├── modules/ # custom NixOS option modules (my.profiles.*, my.hardware.*, my.services.*)
│ ├── environments/ # per-service/app profiles
│ ├── hardware/ # hardware profiles (nvidia, bluetooth, sound, wifi)
│ └── services/ # infrastructure services (vpn, webserver)
└── machines/<name>/
├── configuration.nix # machine-specific NixOS settings
├── environments.nix # enables profiles via my.profiles.* / my.hardware.* options
├── disks.nix
└── hardware-configuration.nix
```
### Profile / Module Pattern
Every module under `modules/` follows the same structure:
```nix
{ config, lib, pkgs, ... }:
let cfg = config.my.profiles.<name>; in
{
options.my.profiles.<name>.enable = lib.mkEnableOption "...";
config = lib.mkIf cfg.enable { ... };
}
```
Namespaces in use:
- `my.profiles.*` — application/service profiles
- `my.hardware.*` — hardware profiles
- `my.services.*` — infrastructure services
Profiles are enabled per-machine in `machines/<name>/environments.nix`.
### Unstable Packages
`pkgs.unstable` is available everywhere via an overlay defined in `machines/configuration.nix`. Use it when a package isn't in the pinned stable channel (`nixpkgs/nixos-25.11`).
### Homepage Dashboard Integration
Modules that expose a web UI can self-register with the homepage dashboard by adding to `my.homepage.services`:
```nix
my.homepage.services = [{
group = "Services";
name = "My Service";
description = "...";
href = "http://${hostName}:PORT";
icon = "si-iconname"; # optional
}];
```
### Adding a New Service Module
1. Create `modules/environments/<name>/default.nix` following the profile pattern above.
2. Add `./environments/<name>` to `modules/environments/default.nix` (or the relevant `default.nix`).
3. Enable it in the target machine's `machines/<name>/environments.nix`.
Generated
+48 -34
View File
@@ -21,11 +21,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1777988971, "lastModified": 1778716662,
"narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=", "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff", "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -42,11 +42,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1775087534, "lastModified": 1778716662,
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -69,11 +69,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1776796298, "lastModified": 1781733627,
"narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=", "narHash": "sha256-U3yTuGBnmXvXoQI3qkpfEDsn9RovQPAjN7ndRco+3u0=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad", "rev": "3bbec39bc90eadfa031e6f3b77272f3f60803e39",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -92,11 +92,11 @@
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1778249748, "lastModified": 1782337899,
"narHash": "sha256-D+3kaW4NUUaiFTsEpmregtGZVniljBThg/O0JIjRL8k=", "narHash": "sha256-Imevyelg3r2N5iDonnGdOKGRiB56m3HgVFAljTB3CLU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "616df97974fd29b79f83502f63854d6d471ee055", "rev": "3887a906b178836818a62e8eba666ad652e8a388",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -142,12 +142,15 @@
} }
}, },
"nixos-hardware": { "nixos-hardware": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": { "locked": {
"lastModified": 1778143761, "lastModified": 1782379505,
"narHash": "sha256-lkesY6x2X2qxlqLM7CT2iM/0rP2JB7fruPN3h8POXmI=", "narHash": "sha256-zPvPiU+a7pqtH47xrtZLNRABJKpOjfZQclDbcvNtH+I=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "3bcaa367d4c550d687a17ac792fd5cda214ee871", "rev": "603d3afd1b6145bd66e97ae38a34d91c95df70cf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -158,15 +161,15 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1771903837, "lastModified": 1780902259,
"narHash": "sha256-jEA8WggGKtMFeNeCKq3NK8cLEjJmG6/RLUElYYbBZ0E=", "narHash": "sha256-YMnBf9lk/LYgvqfmSSJuOGigtRs5Lsy26pJHVlR9yMY=",
"rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951", "rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixos/25.11/nixos-25.11.6495.e764fc9a4058/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.1550.bd0ff2d3eac2/nixexprs.tar.xz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://channels.nixos.org/nixos-25.11/nixexprs.tar.xz" "url": "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz"
} }
}, },
"nixpkgs-23-11": { "nixpkgs-23-11": {
@@ -218,12 +221,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1777954456, "lastModified": 1782467914,
"narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", "narHash": "sha256-inDx/w70OSJoJPqtKh0BrzAsbZZhpya7YgS43jHnhwg=",
"owner": "NixOS", "rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
"repo": "nixpkgs", "type": "tarball",
"rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1022855.e73de5be04e0/nixexprs.tar.xz"
"type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
@@ -233,16 +235,28 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1778003029, "lastModified": 1767892417,
"narHash": "sha256-q/nkKLDtHIyLjZpKhWk3cSK5IYsFqtMd6UtXF3ddjgA=", "narHash": "sha256-8bW3q88CEg2u4hSP66Vf4lpbLonHz7hqDNBMcCY7E9U=",
"owner": "NixOS", "rev": "3497aa5c9457a9d88d71fa93a4a8368816fbeeba",
"repo": "nixpkgs", "type": "tarball",
"rev": "0c88e1f2bdb93d5999019e99cb0e61e1fe2af4c5", "url": "https://releases.nixos.org/nixos/unstable/nixos-26.05pre924538.3497aa5c9457/nixexprs.tar.xz"
"type": "github" },
"original": {
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1782375420,
"narHash": "sha256-f+/IH5ng5P91VHrhcNxqpW2RYDySD68V1fcX00COQy4=",
"rev": "4062d36ebeae843c750011eef6b61ec9a9dbc9a9",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/26.05/nixos-26.05.3250.4062d36ebeae/nixexprs.tar.xz"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-25.11", "ref": "nixos-26.05",
"type": "indirect" "type": "indirect"
} }
}, },
@@ -252,7 +266,7 @@
"nix": "nix", "nix": "nix",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"
} }
} }
+1 -2
View File
@@ -3,7 +3,7 @@
inputs = { inputs = {
nix.url = "github:NixOS/nix"; nix.url = "github:NixOS/nix";
nixpkgs.url = "nixpkgs/nixos-25.11"; nixpkgs.url = "nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
nixos-hardware.url = "github:NixOS/nixos-hardware"; nixos-hardware.url = "github:NixOS/nixos-hardware";
@@ -11,7 +11,6 @@
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# hyprland.url = "github:hyprwm/Hyprland";
}; };
+2 -2
View File
@@ -10,7 +10,7 @@
./disks.nix ./disks.nix
./hardware-configuration.nix ./hardware-configuration.nix
./environments.nix ./environments.nix
# ./network.nix ./network.nix
]; ];
networking.hostName = "jupiter"; networking.hostName = "jupiter";
@@ -48,7 +48,7 @@
# Try fix wifi disconnect # Try fix wifi disconnect
networking.networkmanager.wifi.powersave = false; networking.networkmanager.wifi.powersave = false;
# Disable hibernate completely # Disable hibernate completely
powerManagement.enable = true; powerManagement.enable = true;
systemd.targets."hibernate".enable = false; systemd.targets."hibernate".enable = false;
+1 -1
View File
@@ -7,4 +7,4 @@ _: {
domain = "jupiter.solar.internal"; domain = "jupiter.solar.internal";
search = [ "jupiter.solar.internal" ]; search = [ "jupiter.solar.internal" ];
}; };
} }
+1 -1
View File
@@ -36,7 +36,7 @@
hardware.nvidia.prime = { hardware.nvidia.prime = {
sync.enable = true; sync.enable = false;
nvidiaBusId = "PCI:01:00:0"; nvidiaBusId = "PCI:01:00:0";
intelBusId = "PCI:00:2:0"; intelBusId = "PCI:00:2:0";
+1 -1
View File
@@ -19,7 +19,7 @@ in
my.hardware = { my.hardware = {
bluetooth.enable = true; bluetooth.enable = true;
sound.enable = false; sound.enable = false;
nvidia.enable = true; nvidia.enable = false;
}; };
my.services = { my.services = {
vpn.enable = true; vpn.enable = true;
@@ -8,6 +8,7 @@
let let
cfg = config.my.profiles.audiobookshelf; cfg = config.my.profiles.audiobookshelf;
hostName = config.networking.hostName; hostName = config.networking.hostName;
domain = config.networking.domain;
in in
{ {
options.my.profiles.audiobookshelf = with lib; { options.my.profiles.audiobookshelf = with lib; {
@@ -32,7 +33,7 @@ in
group = "Media"; group = "Media";
name = "Audiobookshelf"; name = "Audiobookshelf";
description = "Audiobooks and podcasts"; description = "Audiobooks and podcasts";
href = "http://${hostName}:63834"; href = "http://${domain}:63834";
icon = "audiobookshelf.png"; icon = "audiobookshelf.png";
} }
]; ];
@@ -11,11 +11,6 @@ let
hostName = config.networking.hostName; hostName = config.networking.hostName;
in in
{ {
imports = [
# services.openthread-border-router isn't in nixos-25.11; pull from
# nixpkgs-unstable. Package comes from the existing unstable overlay.
"${self.inputs.nixpkgs-unstable}/nixos/modules/services/home-automation/openthread-border-router.nix"
];
options.my.profiles.home-assistant = with lib; { options.my.profiles.home-assistant = with lib; {
enable = mkEnableOption "Home Automation"; enable = mkEnableOption "Home Automation";
@@ -34,6 +29,8 @@ in
"otbr" "otbr"
"thread" "thread"
"xiaomi_miio" "xiaomi_miio"
"apple_tv" # Apple TV (pyatv); pair via UI PIN flow
"tuya" # Tuya/SmartLife cloud; Unistyle WLAN irrigation computer
]; ];
}; };
services.home-assistant.config = { services.home-assistant.config = {
@@ -43,7 +40,7 @@ in
internal_url = "http://${hostName}:8123"; internal_url = "http://${hostName}:8123";
external_url = "http://jupiter.solar.internal:8123"; external_url = "http://jupiter.solar.internal:8123";
}; };
mobile_app = {}; mobile_app = { };
automation = "!include automations.yaml"; automation = "!include automations.yaml";
script = "!include scripts.yaml"; script = "!include scripts.yaml";
scene = "!include scenes.yaml"; scene = "!include scenes.yaml";
+1 -1
View File
@@ -7,7 +7,7 @@
let let
cfg = config.my.profiles.homepage; cfg = config.my.profiles.homepage;
dashboardPort = 8082; dashboardPort = 8082;
dashboardHost = config.networking.hostName; dashboardHost = config.networking.domain;
dashboardUrl = "http://${dashboardHost}:${toString dashboardPort}"; dashboardUrl = "http://${dashboardHost}:${toString dashboardPort}";
manualServices = import ./manual-services.nix; manualServices = import ./manual-services.nix;
manualWidgets = import ./manual-widgets.nix; manualWidgets = import ./manual-widgets.nix;